Kentico 13 - How to add BCC to the marketing email?

69 Views Asked by At

I want to add BCC to the marketing email. Is there any way to do that?

enter image description here

I tried using the below code. But it did not work.

public override void Init()
{
    EmailInfo.TYPEINFO.Events.Insert.Before += Email_Insert_Before;
}

private void Email_Insert_Before(object sender, ObjectEventArgs e)
{
    var email = e.Object as EmailInfo;
    email.EmailBcc = "[email protected]";
    EmailInfo.Provider.Set(email);
}
1

There are 1 best solutions below

1
On

The Insert Before event is probably not the one you are looking for to customize marketing automation processes / steps. It would be easier to implement a custom Action (Marketing Automation -> Actions -> New) and tie the Action configuration to the a custom C# class. Once you have a new action, you can add Parameters to it. You could add a Parameter to let the admin configure the Email BCC.

Documentation on how to do that is here: https://docs.xperience.io/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-marketing-automation/developing-custom-marketing-automation-actions