0

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 = "admin@company.com";
    EmailInfo.Provider.Set(email);
}

1 Answers1

1

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

Mcbeev
  • 1,519
  • 9
  • 9
  • Thank you for your reply @Mcbeev . Sorry for sounding dumb. How can we add the Bcc to the marketing email? The marketing email is triggered from the code, and I am using the following code. MarketingAutomationHelper.AddContactToWorkflow(contact, "NOTIFICATIONConfirmationOfCancellation"); The email is sent to the contact. However, I am not able to add BCC to that email. Can you suggest to me the code to do that? As you suggested, I am unsure how to do that in Action's Execute method. – dilip thakuri Nov 15 '22 at 07:39