Email template Macro issue

Wei Wang asked on March 29, 2021 18:12

Hi,

I have an email template using some macros. The email macro is in the code in the ObjectrEvents.cs using Tuple.Create. The html text uses string.format and I have to format it into html talbes, with tags. The problem is, when I add this macro {% tableformattingmacro %} like this to the email template in the CMS desk, the email message it generated from Kentico won't resolve the tags. It just simply displays these tags in the email body. I can't seem to find a way to make this work.

Any ideas how to make the macro to recognize the html tags in the Kentico email template?

We are on Kentico 11.0.48 portal engine.

Thanks, Wei Wang

Recent Answers


Juraj Ondrus answered on March 30, 2021 06:46

Have you tried using {% Macro|(encode)true %} or {% HTMLEncode(Macro) %}

0 votesVote for this answer Mark as a Correct answer

Wei Wang answered on March 30, 2021 13:59

Yes, I tried but no difference.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on March 30, 2021 14:05

Would it be possible to debug your macro code? I just tried using out of the box macro e.g. in an ecommerce email template like e.g. {%HTMLEncode(Order.OrderNote)#%} and it is working fine.

0 votesVote for this answer Mark as a Correct answer

Wei Wang answered on March 30, 2021 14:08

Let me try again. Thanks

0 votesVote for this answer Mark as a Correct answer

Wei Wang answered on March 30, 2021 14:46 (last edited on March 30, 2021 14:52)

No, it still not rendering the html tags like
, , etc

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.