Salesforce Apex for managing Email Opt Outs

  • 1
  • Problem
  • Updated 1 year ago
  • Acknowledged
Hello,

I am looking for the best way to go about adding and removing Emma Group Members through Apex in Salesforce.

For people who would like to "Opt In" I am doing
emma__Emma_Group_Member__c emmaGroupMember = new emma__Emma_Group_Member__c();
emmaGroupMember.emma__Contact__c = myContact.Id;
emmaGroupMember.emma__Emma_Group__c = emmaGroupID;
emmaGroupMember.emma__Sync_Status__c = 'Pending';
INSERT emmaGroupMember;

For those who want to "Opt Out" I am just deleting their emma__Emma_Group_Member__c record.

Thanks!
Photo of Jon

Jon

  • 1 Post
  • 0 Reply Likes

Posted 1 year ago

  • 1
Photo of Zach Sharpe

Zach Sharpe, Employee

  • 290 Posts
  • 32 Reply Likes
Hey Jon!

While we would not support any customizations made within your Salesforce integration, I was able to find resource on Apex syntax here: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm that will hopefully point you in the right direction.

I hope this helps and certainly let us know if we can answer any questions on Emma functions!

Cheers,

Zach