In case anyone else is looking for a similar functionality, what I ended up doing is targeting the EmailInfo.TYPEINFO.Events.Insert.Before global event and attaching a handler to it to use the ‘To’ field as the ‘Bcc’ field.
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.EmailTo;
email.EmailTo = "no-reply@website.com";
}
My only concern is the performance of this set up. I imagine in the case of email marketing where it sends out many copies of an email, it could get quite slow.
Any ideas on the performance of this and how could I improve it if it is slow?