function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Davy HuijgensDavy Huijgens 

Setting an EmailTemplateId in a QuickActionDefaultsHandler ignores all changes to EmailMessage

I have implemented a QuickAction.QuickActionDefaultsHandler to prepopulate the email action in the case feed in the service console.

In the handler I want to set the subject of the email, this is done like this:
 
if(sendEmailDefaults.getInReplyToId() != null){
    emailMessage.Subject = 'Re: ';    
}else{
    if(et.Subject != null){
        emailMessage.Subject = et.Subject;
    }else{
        emailMessage.Subject = c.Subject;
    }
}

This works fine, until I also set an EmailTemplate:
 
sendEmailDefaults.setTemplateId(et.Id);
sendEmailDefaults.setIgnoreTemplateSubject(true);
sendEmailDefaults.setInsertTemplateBody(true);

Now the subject just defaults back to the orignal subject of the EmailMessage targetSObject of the QuickAction.SendEmailQuickActionDefaults.

Anybody have any idea why this is happening?
Best Answer chosen by Davy Huijgens
Davy HuijgensDavy Huijgens
For anybody finding this a case with Salesforce support resulted in stating that this is not supported and will not work.