API
Version 7.x > API > How can I transform an EmailTemplate without sending it? View modes: 
User avatar
Member
Member
jonathas.costa-br.icap - 9/25/2013 5:38:39 PM
   
How can I transform an EmailTemplate without sending it?
Is there anyway of transform an email using MacroResolver and EmailTemplateInfo without sending it? I mean, I would like to use Kentico as a Template Engine, just that.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/25/2013 7:32:26 PM
   
RE:How can I transform an EmailTemplate without sending it?
Take a look at this FAQ post. You can get the email template and save the template properties, resolve the macros and save it off to your own objects as needed.

User avatar
Member
Member
jonathas.costa-br.icap - 9/26/2013 7:23:33 AM
   
RE:How can I transform an EmailTemplate without sending it?
I'm a little confused. If I call EmailSender.SendEmailWithTemplateText, am I sending the e-mail?

I'm asking that because my server is in DMZ and don't have access to out Outlook/SMTP server.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 9/26/2013 10:01:10 AM
   
RE:How can I transform an EmailTemplate without sending it?
Just because you're in a DMZ doesn't mean you can't sent it. It simply means your network admin is restricting you to have access to your SMTP server. Pretty simple to poke a hole for that server to request that acces.

In regards to your confusion, yes that method will send the email but what I was getting at is the functionality before that particular method. The functioality before that method shows you how to get an email template, resolve macros and assign the values to other objects, in this case a Kentico Email object. You could simply take the email template info and assign its properties to any string you want. For instance if you wanted to display the message on a page, simply take the results of the eti.Subject and assign it to a label or whatever control you have on the page.