on 2018 Nov 24 7:28 AM
Hi Experts,
I need to give a link in my email template (Ex: View in browser). On click of that link, same email must be opened in a web browser.
Request clarification before answering.
Hi ,
If you use any third-party mail services they may provide such functionality. Ex: Mailchimp
If you are not using any as such services, You can host the HTML in your external server as .html files and refer the URL for the email every time.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
It's quite simple, Hybris internally prepares HTML and creates an EmailMessageModel internally to send the email.
So EmailMessageModel contains an attribute called bodyMedia(MediaModel) which holds HTML version of the email.
bodyMedia contains code , now while sending email, keep that link in the mail body, a view in the browser which contains href link as https:host/view-mail/media-code
When the user tries to open the link, your custom controller must fetch MediaModel (use DefaultMediaService) and return the html from getURL.
You can see all generated email HTML in the following folder,
hybris\data\media\sys_master\email-body\
Note : In your email-process xml you need disable the remove email action for those mails which you want to provide view in browser feature. If you don't disable you can't fetch the data.

Please let me know if you have questions, accept it as answer if it helps ur requirement.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.