Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Email template subject encoding

Martin-Nekula
Level 2
Level 2

Hello,

we have a long-term problem with encoding in email subjects, where characters like "šáěíéščřý" are not shown correctly. Until now, we have been changing the subjects to use basic ascii letters. But now we are expanding to russian customers, and with azbuka (cyrilic) letters we can no longer do this.

In principle, our mechanism is the same as described here: https://adobe-consulting-services.github.io/acs-aem-commons/features/e-mail/email-api/index.html

Where they are discussing the same problem in the comments below the article, with a final workaround: https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/1030

However, that would still mean to separate the subject from the template. That would mean additional work with moving the subjects from templates to the i18n dictionary.

So, is this the only solution as to now?

Best Regards

Martin

email encoding template
1 Accepted Solution
Martin-Nekula
Correct answer by
Level 2
Level 2

Apache Sling Request Parameter Handling configuration for the Default parameter encoding is set correctly to UTF-8, that is not the problem.

With lack of any other answers the workaround mentioned here is still the best approach https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/1030

View solution in original post

4 Replies
KiranVedantam1992
Community Advisor
Community Advisor

Hi @Martin-Nekula,

 

Please check Apache Sling Request Parameter Handling configuration for the Default parameter encoding" for your instance. Generally this encoding is used to display or send the data [which can include special characters as well]. If you are using the AEM default Day CQ Mail Service checking this would be helpful.

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Martin-Nekula
Level 2
Level 2

Hello Kiran,

thank you for the answer. Yes, we are using the default one and the encoding is set to UTF-8. I think that shouldn´t be a problem, because the body of the emails is always displayed correctly and if we set the subject in code via

org.apache.commons.mail.HtmlEmail.setSubject()

 then the subject is displayed correctly as well. Problem is when the subject is taken from the mail template.

 

Martin-Nekula
Correct answer by
Level 2
Level 2

Apache Sling Request Parameter Handling configuration for the Default parameter encoding is set correctly to UTF-8, that is not the problem.

With lack of any other answers the workaround mentioned here is still the best approach https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/1030

View solution in original post

kautuk_sahni
Community Manager
Community Manager
Thank you for sharing the solution with AEM community.