Salesforce Apex for managing Email Opt Outs

  • 1
  • Problem
  • Updated 2 years ago
  • Acknowledged

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.

Photo of Jon


  • 1 Post
  • 0 Reply Likes

Posted 2 years 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: 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!