Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > E-mail Templates Template View modes: 
User avatar
Member
Member
ctaleck IPAGlobal - 3/12/2010 1:11:39 PM
   
E-mail Templates Template
No, that subject is not a typo!

I have just started using E-mail templates and I was wondering if there was a way to implement a HTML template for all the Membership ones?

I was thinking of using a Localization macro to insert the same HTML top and bottom code around my e-mail text, but this is encoded HTML so it did not render.

Are there any other ideas that will work? I just want to make sure they are all the same without having to copy-and-paste in all 10 of the Membership e-mail templates.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 3/15/2010 10:09:30 AM
   
RE:E-mail Templates Template
Hello,

I would recommend you the mentioned localization macros. You may make the HTML formatting work by (encode)false parameter in that macro. Please see here: http://devnet.kentico.com/docs/devguide/appendix_a___macro_expressions.htm for more details (Macro parameters section).


Best regards,
Helena Grulichova

User avatar
Member
Member
ctaleck IPAGlobal - 3/15/2010 1:40:11 PM
   
RE:E-mail Templates Template
Very good. The full and correct syntax for the command is
{%GetResourceString("emailhtmltemplate.head")|(encode)false%}
<p>...your content...</p>
{%GetResourceString("emailhtmltemplate.foot")|(encode)false%}
However, there is one "gotcha!" If you use any macros in the template itself, you need to add the same macro parameter or it will encode the string. For example, I used a macro in the title tag in the head template:
<title>{%domain|(encode)false%}</title>
Thanks for the help on this one.

User avatar
Member
Member
snk1324 - 7/8/2011 6:09:54 AM
   
RE:E-mail Templates Template
I am trying to use the (encode) paramter, but with something like this:

{%if (OrderStatus.StatusDisplayName == "Payment received") { "This is a <b>test</b>" } else { "A different <b>test</b>" }%}


How would I use the (encode) parameter in this case? If I don't use it (As above), my e-mails include the html code in the text of the email, and don't properly display as bold. The administration setting for the type of e-mail is correctly set to HTML as well.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/11/2011 3:09:12 AM
   
RE:E-mail Templates Template
Hi,

the macro is correct. You do not need to use encode parameter and the macro itself will be resolved correctly (for example in Content Before property of web part). The issue here is that in the E-commerce e-mail template is the content encoded by default for security reasons, i.e. resolver.EncodeResolvedValues = true;

The workaround is to create a custom macro and inside the macro use a following line of code:
sender.AllowParameters = false;

This way the html code will not be encoded.

To access relevant e-commerce value in your custom macro please take a look here:
Customizing invoice and e-mail templates

Best regards,
Ivana Tomanickova



User avatar
Member
Member
snk1324 - 7/11/2011 8:06:05 AM
   
RE:E-mail Templates Template
Using the encode worked fine once I figured out to apply it.

User avatar
Member
Member
thakarshi.makwana-booksellers.org - 12/15/2011 5:02:45 AM
   
RE:E-mail Templates Template
Hi,

I am still beginner in kentico CMS. I am working on one project that developed by previous developer. What happening atm in Kentico 4.0 when user move or delete any document from tree in CMS desk(left document menu). One email send to external users. Now its not functioning properly. And I am enable to find from where email is going out.

If U can guide on same issue then it will really great help.

Thank U

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 12/15/2011 8:38:29 AM
   
RE:E-mail Templates Template
Hello,

It's possible, that a custom handler is used. For more information on where to look for the code please check this link.

Best regards,
Boris Pocatko