You need to sign in to do that
Don't have an account?
Send customer an email after CaseComment
Hello,
I've been having some issues getting emails to send when inserting a CaseComment. I'm currently using the nForce npm module as my program is written for use with nodejs.
Some sample code
const casecoment = nforce.createSObject('CaseComment', { CommentBody: 'API-based nForce test for a comment', ParentId: cParentId, IsPublished, }); org.insert({ sobject: casecoment, oauth, }, (err, resp) => { if (err) { console.log("Could post to case comment"); console.log(JSON.stringify(err)); } else { console.log('posting comment worked!'); } });
What I'm wondering is what else I may need to do in order to get emails for case updates to the contact sent out. I'm able to get emails as the case owner without any issues. On the CaseComment sObject page, I saw that "IsNotificationSelected" is a column I can read, but isn't something I can create as I just receive an error when adding it to my code above.
Is there a way to programmatically have the notification email sent out like the "Send Customer Notification" in the website interface?
So APEX code will be like below:
Database.DMLOptions dmlOptions = (Database.DMLOptions) JSON.deserialize(dmlOptionsStr, Database.DMLOptions.Class);
results = Database.Insert(sObjectList,dmlOptions);
And lightning code will be like below:
var dmlOptions = {
"optAllOrNone" : true,
"EmailHeader" : {
"triggerOtherEmail": true,
"triggerUserEmail": true,
}
};
Stringify dmlOptions using below line and use it to send to APEX:
JSON.stringify(dmlOptions)