0

I'm trying to configure a quick Send Email action in Aura, some of the fields are okay but some just won't prepopulate...

var actionAPI = component.find("quickActionAPI");
var fields = {//WhoId: {value: contactRecord.Id},
                EmailTemplateId: {value: "00Xb0000000Z5CVEA0"}, 
                RelatedToId: {value: accountRecord.Id},
                Subject: {value: "Mifid"},
                HtmlBody: {value: "Mifid", insertType: "cursor"},
                CcAddress: {value: contactRecord.Owner.Email + (userRecord.Manager ? ";"+userRecord.Manager.Email : "")}
            };
var args = { actionName: "SendEmail" , targetFields: fields};
actionAPI.setActionFieldValues(args);

This is the result I get:

enter image description here

Subject, Body, CcAddress are all filled up correctly, but the email template isn't and the related lookup either. I don't know what I'm doing wrong.

Thanks!

0

It seems that this is not supported. There is an open Idea here and a confirmation from SF that you cannot add predefined template in quick action. See here

Predefined email templates is not yet supported. The Template field was added to support Classic Email Templates and should not be used to predefine templates.

Also looking at fields for this actions, I see that EmailTemplateId is a lookup field

{"fieldName":"EmailTemplateId","type":"placeholderLookup"}

Trying this by passing an object results in an error

var fields = {
    EmailTemplate: {Id: "00X1l000000hc5vEAA"}, 
            
    CcAddress: {value: "myemail@domain.com"}
};
1
  • OK, thank you for the answer ! Do you have any idea as to why the other field doesn't work ? (the RelatedToId field), it's also a lookup...
    – Lucille
    May 29 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.