Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salesforceBen/df1a1c7efc6b42ecfcd14b900e0372ad to your computer and use it in GitHub Desktop.
Save salesforceBen/df1a1c7efc6b42ecfcd14b900e0372ad to your computer and use it in GitHub Desktop.
Contact c = new Contact();
c.lastName = 'Andy The Customer';
c.Email = 'andy@theCustomerEmailAddress.com';
insert c;
Case theCase = new Case();
insert theCase;
EmailMessage theEmailMessage = new EmailMessage();
theEmailMessage.BccAddress = 'compliance@mostexcellentsoftware.com';
theEmailMessage.CcAddress = 'IaaSTeam@mostexcellentsoftware.com, SaaS@mostexcellentsoftware.com, PaaS@mostexcellentsoftware.com';
theEmailMessage.FromAddress = 'CustomerService@mostexcellentsoftware.com';
theEmailMessage.TextBody = 'Hello, I want to understand a few things about your SaaS offering.';
theEmailMessage.ParentId = theCase.Id;
theEmailMessage.toAddress = 'andy@theCustomerEmailAddress.com';
theEmailMessage.Subject = 'What is your SaaS Product Offering?';
insert theEmailMessage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment