-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.2] Feat: Introduce Mail Template Layout #43829
Conversation
Co-authored-by: Brian Teeman <[email protected]>
@brianteeman if you want to change it by review in the language files I can commit directly :) |
Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Brian Teeman <[email protected]>
Co-authored-by: Brian Teeman <[email protected]>
I am really happy to see this. It's the missing link to truly make branded html mails. Basic functionality all works great. |
When per template email setting is set to NO then I would not expect to see the layout options per email - is that an error/bug When per template email setting is set to YES I have the option to enable the layout and select a layout but I cannot select an image - is that an error/bug or by design. I am hoping its an error/bug as I would use log as an image header |
Thanks @LadySolveig . That it is very good feature. Some thoughts for future. $mailTemplate->embedImages([
'header-image' => 'path/to/image.jpg',
'logo-image' => 'path/to/logo.jpg'
]); // Then in layout:
<img src="cid:header-image" alt="inline image"/>
<img src="cid:logo-image" alt="logo image"/> But I not sure how to correctly interconnect it. Do not code it here, just ideas for future. 😉 |
…' from the site URL link text
I have tested this item ✅ successfully on 1e2cb33 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43829. |
1 similar comment
I have tested this item ✅ successfully on 1e2cb33 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43829. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43829. |
I have tested this item ✅ successfully on 1e2cb33 As discussed with Martina, I should note that Scenarios 1-5, I had my Mailer set to PHP Mail and they worked fine, Scenario 6 gave an Could not instantiate mail function but when I switched the mailer to Sendmail that scenario worked. Scenario 7 worked on PHP Mail. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43829. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question in general, why do we need a layout.php file and not use the mail template component it self and save the base html layout in the database so people can adapt it easily at the place where all other mail layouts are stored?
administrator/components/com_mails/src/Field/MailtemplateLayoutField.php
Outdated
Show resolved
Hide resolved
No please, it is like saving index.php of the main template in database. |
tbh, we need to be more user friendly for end users and they are unable (or don't want to) to touch php documents. |
This kind of thing is for "advanced user", it is not average HTML that can be edited in TinyMCE. |
@HLeithner Is that what you mean by user friendly if I have to remember to adapt several templates (for each language one) individually in backend just because I want to change a mail from address for a single use case (MailTemplate), for example? ;) |
yeah don't care anyway please just fix the broken database query thanks |
I suspect most people will just be happy to have real html emails with the default layout - I know I am |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
I'm merging this even though since this was set to RTC, additional changes were made. However those changes were basically codestyle fixes and have been reviewed by me. Thank you for your contribution @LadySolveig! This will be a great feature. |
joomla/joomla-cms#43232 + joomla/joomla-cms#43378 + joomla/joomla-cms#43216 + joomla/joomla-cms#43260 + joomla/joomla-cms#43386 + joomla/joomla-cms#43575 + joomla/joomla-cms#43491 + joomla/joomla-cms#43760 - (upmerge, внесено в 5.1х) joomla/joomla-cms#43247 + joomla/joomla-cms#43579 + joomla/joomla-cms#43690 + joomla/joomla-cms#43829 + joomla/joomla-cms#43840 + joomla/joomla-cms#43841 + joomla/joomla-cms#43885 - (upmerge, только для др. пакетов) joomla/joomla-cms#43223 + joomla/joomla-cms#43810 - (только для en-GB) joomla/joomla-cms#43898 + joomla/joomla-cms#43432 + joomla/joomla-cms#43870 + joomla/joomla-cms#42850 + joomla/joomla-cms#43937 - (upmerge, только для др. пакетов) joomla/joomla-cms#43862 + joomla/joomla-cms#43975 + joomla/joomla-cms#43910 + joomla/joomla-cms#43965 + joomla/joomla-cms#43738 + joomla/joomla-cms#43814 + joomla/joomla-cms#44000 + joomla/joomla-cms#44050 + (upmerge, с 4.4.9) joomla/joomla-cms#43966 + joomla/joomla-cms#44065 +
I have tried the new main template feature, but I cannot seem to find the posibility for an override of the layout in the Cassiopeia template ?? Where should that be ? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43829. |
|
Ahh sorry - found it now. |
Pull Request for Issue #39492 .
Summary of Changes
--The functionality for displaying the logo and sending it as an inline attachment depends on this fix #43828--merged--Depends on #43842 --mergedAdd support for mail template layouts as a parent wrapper around the existing mail templates.
mailtemplate.php
for rendering mail content with sitename in footer and optional logo.MailtemplateLayoutField
to list available mail template layouts (overrides) from (frontend) templates.MailTemplate
class to handle layout data and render email content using the specified layout.config.xml
to enable/disable HTML layout and select a mail template layout globally.template.xml
to include options for disabling HTML layout and selecting a mail template layout individual for each template.TemplateModel
to remove HTML layout fields when the mail style is set to plaintext.Testing Instructions
Global Configuration -> Mail Templates
Set
Mail Format
--> HTMLSetup global Mail Templates configration for Mail Template Layouts as follows:
Scenario 1
Per Template Settings are
disabled
in the Global Configuration:Go to
System
-->Mail Templates
--> openGlobal Configuration: Test Mail
No additonal options in template edit view and the global settings are used.
Go to
System
-->Global Configuration
-->Tab: Server
Scroll to the bottom and send out test mail
Your Test Mail should look similar like this
Scenario 2
Per Template Settings are
enabled
in the Global Configuration:Send the test mail again - the mail should look the same as in the previous step.
Scenario 3
Go to
System
-->Mail Templates
--> openGlobal Configuration: Test Mail
Your Test Mail should look similar like this
Scenario 4
Go to
System
-->Site Templates
--> open your Template -->Tab: Create Overrides
and add overridejooml->mail
Open file html --> joomla --> mail --> mailtemplate.php
and add this text
This is a test for template overrides
Go to
System
-->Mail Templates
--> openGlobal Configuration: Test Mail
Set Logo File -->
enables
Choose your layout override
Your Test Mail should look similar like this
Scenario 5
Go to
System
-->Mail Templates
--> openGlobal Configuration: Test Mail
Choose Layout -->
Use Global
Go to
System
-->Global Configuration
-->Mail Templates
Choose your layout override
Your Test Mail should look like in the step before
Scenario 6
Go to
System
-->Global Configuration
-->Mail Templates
Your Test Mail should look similar like this
Scenario 7
Go to
System
-->Global Configuration
-->Mail Templates
Choose your layout override
Go to
System
-->Site Templates
--> open your TemplateOpen file html --> joomla --> mail --> mailtemplate.php
and add this text
{METHOD}
Your Test Mail should look similar like this
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed