API
Version 7.x > API > Using ApplyTransformation in custom EMail Template View modes: 
User avatar
Certified Developer v6
Certified Developer v6
Dave - 2/26/2013 4:07:31 PM
   
Using ApplyTransformation in custom EMail Template
Hi,

I'm using the API to send an email with a set of custom parameters and a specific EMail Template. This is working fine, but I am also trying to bind an IEnumerable to a Transformation in the EMail Template. I am using the ContextResolver's SetNamedSourceData to insert the IEnumerable, but the EMail Template does not seem to be picking it up. Do you have a code example of how this can be accomplished?

Thanks,
Dave

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 3/2/2013 10:22:10 AM
   
RE:Using ApplyTransformation in custom EMail Template
Hi,

As we discussed in the emails, unfortunately, there are no nice examples available.

You could try to run your code outside the email template - just try or even debug it anywhere else (e.g. in separate control or page).
As it's basically a K# context macro, you could try to get more details using Macro debug

Could you also please check the Event log in Site manager -> Administration -> Event log for any errors related?

According to the discussion in the emails, we'll post more info or solution here later.

Regards,
Zdenek

User avatar
Member
Member
DHood-CPUonline - 9/7/2013 1:49:26 PM
   
RE:Using ApplyTransformation in custom EMail Template
Has there been any update to this? We are attempting to do basically the same thing (insert custom fields added to the OrderItem table into an email template), but can't get those fields to appear after the email is resolved.

User avatar
Member
Member
kentico_sandroj - 9/7/2013 2:33:54 PM
   
RE:Using ApplyTransformation in custom EMail Template
Hello,

Are you also using the API to send the e-mail or are you taking another approach? Would you mind describing how the e-mail are sent and what the goal is? Also, did you extend the table to include a custom column or are you storing the custom values in OrderCustomData?

You may need to set the DataSource for the object (CMS.CMSHelper ► ContextResolver ► SetNamedSourceData()) as described in the resolving macros documentation.

There is also some additional information in the FAQ and KB articles.

Please let me know if you have any additional questions or information.

Best Regards,
Sandro