e-mail template macro resolver

Ei Dar Li Ko Ko asked on May 3, 2015 19:05

I have inserted a data {%subscriberfullname%} to send a mail to the subscriber through the email template but it is not showing any name. Please help. Thanks.

Recent Answers

Richard Sustek answered on June 2, 2015 09:51


How are you assigning the "subscriberfullname" value to the macro resolver? Am I understand you correctly that you are sending the e-mail from a template using API?

Have you tried assigning the macro using this way?:

EmailMessage msg = new CMS.EmailEngine.EmailMessage();
EmailTemplateInfo eti = EmailTemplateProvider.GetEmailTemplate("MyTemplate", CurrentSite.SiteID);
MacroResolver mcr = new MacroResolver();
mcr.SetNamedSourceData("subscriberfullname", "Insert your name");
msg.EmailFormat = EmailFormatEnum.Both;
msg.From = eti.TemplateFrom;
msg.Recipients = "name@domain.com";
msg.Subject = eti.TemplateSubject;
EmailSender.SendEmailWithTemplateText(CurrentSite.SiteName, msg, eti, mcr, true);

In your template you can then use the macro and it will get resolved when you send the e-mail.

Hope it helps!

Kind regards,

Richard Sustek

0 votesVote for this answer Mark as a Correct answer

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