API
Version 7.x > API > Email Template Type View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 2/5/2013 12:26:00 PM
   
Email Template Type
When creating a new email template, I'd like to modify the Type Selector dropdown and add additional selections in there. From what I see I need to do a few steps, can anyone confirm/deny these steps and what else I might need to do or not do or if this is even a good idea.

1. Add additional Enum items in App_Code\CMSModules\Macros\EmailTemplateMacros.cs
2. Modify GetEmailTypeEnum(string emailType) in file above and add new case lines.
3. Modify GetEmailTypeString(EmailType emailType) in file above and add new case lines.
3. Create a new ContextResolver in above file.
4. Modify GetEmailTemplateResolver(EmailType type) in above file and add new case lines.
5. Add additional Resource strings in CMSResources\CMS.resx (or can I do this in Site Manager>Development>UI Cultures?).

Then when I create a new email with a template using the API, will I still need to resolve the macros like so?
MacroResolver mcr = new MacroResolver();
mcr.SpecialMacros = new String[,] { { "##one##", "1" }, { "##two##", "2" } };
Or will they be resolved with the steps I've completed above?


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/12/2013 1:50:56 AM
   
RE:Email Template Type
Hi,

1-4: OK
5: You can use the UI cultures (strings saved to DB) if you are using your custom strings. resx file if you want to modify some of the default strings.

E-mails created via API - you have to use the MacroResolver all the time in this case.

Best regards,
Juraj Ondrus