Send Email Notification to different addresses

Aleksandar Nikolić asked on February 2, 2018 10:03

Is it possible to send email notifications to different email addresses depending on the option that was selected in drop-down field in On-Line Form?

Correct Answer

Aleksandar Nikolić answered on February 2, 2018 12:16

Thank you, Dragoljub (ili hvala Dragoljube :) )

I found one more solution now:

https://devnet.kentico.com/articles/how-to-send-form-notifications-to-different-emails-based-on-field-values

1 votesVote for this answer Unmark Correct answer

Recent Answers


Dragoljub Ilic answered on February 2, 2018 10:29 (last edited on February 2, 2018 10:30)

Hi Aleksandar,

I don't know is this is supproted OTB in kentico, but one way how you can do it is by handling it in events (check here possible events for biz form).

When you register your event properly and confirm that is triggered in desirable situations, you can use some of this code to send email notification:

EmailTemplateInfo eti = EmailTemplateProvider.GetEmailTemplate("MyCustomEmailTemplateCodeName", SiteContext.CurrentSiteID);
if (eti != null)
{
    MacroResolver mcr = MacroResolver.GetInstance();
    mcr.SetNamedSourceData("FirstName", "Dragoljub"); //you can get this data(first name) from biz form

    msg.EmailFormat = EmailFormatEnum.Both;
    msg.Recipients = "dragoljub.ilic@test.com";//that you take form online form (separated by ';')
    msg.Subject = eti.TemplateSubject;

    EmailSender.SendEmailWithTemplateText(SiteContext.CurrentSiteName, msg, eti, mcr, true);
}

Best regards, Dragoljub

0 votesVote for this answer Mark as a Correct answer

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