...
Since 2023.3, we’ve introduced a template system for all emails sent by the application. This allows us to automatically use the logos and colors set for the application in the email content. The main purpose is to avoid modifications by the project team since most of the time, all the email contents were only modified to apply the project logo or to change colors.
Email content | Source plugin |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| war |
1/ Template system with velocity and Notification api
...
We can change the generic footer by overriding
footer.html
under the project folder. If, only the text part has to be changed, we can edit the value ofemail_template_footer_part_one
key ofbov3/wcm
bundle.We can also change the specific footers by overriding them under the project folder.
We can also add new specific files as headers, footers, or styles. In this case, the email HTML file needs to be updated to use the newly added specific header, footer, or style.
All bodies content can be changed by overriding them under the project folder and by using the correct path in email html file. Therefore the email html files like
WXM_CART2/res/email/collaborate.html
should also be overriden under__perso/email/project/
placing them under the correct file tree structure.Example with cart share email :
I’ll create a file named share.html which will contain the main body of my email. I’ll then place it under
__perso/email/project/bodies/
. Then when a board is shared, my body content will be used inside the template with the header and the footer.
Note |
---|
The file structure has to be respected for the template system to work properly. If I had created a share.html file directly under |
All bodies content can be changed by overriding them under the customization folder defined in the plugins (WXM_CART2 and PACKAGED_RegistrationEmails)
Example with cart share email :
I’ll create a file named share.html which will contain the main body of my email. I’ll then place it under
__perso/emailTest/
in a new folder calledbodies
. This path has also been set in the params of WXM_CART2. Then when a board is shared, my body content will be used inside the template with the header and the footer.
Note |
---|
The file structure has to be respected for the template system to work properly. If I had created a share.html file directly under |
3/ Backward compatibility
...
title
Title inside the email (email.account_pendingrequest.title
)
body
Body text of the email (email.account_pendingrequest.body
)
reason
Why user is receiving this email (email.account_pendingrequest.reason
)
buttonLabel
Label of the button to review the account request (email.account_request.button
)
...
footer
Footer of the mail body (status_page_mail_link_status_page
)
...
sso/login/send_otp.html
Email subject: bov3/wcm
bundle from key: send_otp_mail_subject
Translatable text inside the template (from bov3/wcm
bundle)
body
Body text of the email (send_otp_mail_subject
)