Required Fields For Secure Email

Label

API Name

 

From Address

cmsecureemail__FromAddress__c

 

Recipients

cmsecureemail__Recipients__c

Comma separated email addresses in case of multiple recipients.

HTML Body

cmsecureemail__HtmlBody__c

 

Parent ID

cmsecureemail__Parent_Record_Id__c

Record ID on which you want the Secure Email to get linked.

Record Type ID

RecordTypeId

 

Reply to Email address

cmsecureemail__Reply_to__c

Should be Org wide email address

Subject

cmsecureemail__Subject__c

 

Sample Apex Code Snippet to create a Secure Email record

 

cmsecureemail__Secure_EmailMessage__c oRecord = new cmsecureemail__Secure_EmailMessage__c(); oRecord.cmsecureemail__FromAddress__c = 'from@email.com'; oRecord.cmsecureemail__Recipients__c = 'to@email.com'; oRecord.cmsecureemail__HtmlBody__c = 'Hello Cloud Maven'; oRecord.RecordTypeId = Schema.SObjectType.Secure_EmailMessage__c.getRecordTypeInfosByDeveloperName().get('Outbound').getRecordTypeId(); oRecord.cm_datatransfer__Parent_Record_Id__c = 'Record ID of the Parent Record'; oRecord.cmsecureemail__Reply_to__c = 'orgwide@email.com'; oRecord.cmsecureemail__Subject__c = 'Test Subject'; insert oRecord;