I have the following business requirements for sending email from Salesforce and I'm wondering if I can accomplish this by building custom components for the email application pane in Lightning:

Users are occasionally choosing the wrong email template and the wrong sent-from email address for important notifications. I need to either restrict the available email templates and sent-from address lists based on a field in the lead or opportunity object that the user is sending from or I need to validate these fields based on a field on the same objects before the email can be sent. I have not found a way to do either of these things using Salesforce Classic but it looks possible in Lightning.

Also, if there's a difference between what I can do with a Gmail or Outlook integration, please advise as it will help to determine an adoption decision.

Thanks in advance for any suggestions or advice on this.

1 Answer 1


What I've learned so far is that the People object, which exposes email addresses is not writable, meaning that I can't change To: and From: email addresses from within Salesforce. Similarly, according a response I got from Salesforce, both the Gmail Body and the Subject fields are also read-only. Basically, this means that you can't manipulate the email in the Gmail composition modal in any way, although Salesforce told me that making the subject and body fields writable is on the roadmap. So, if you need to do more than perform some kind of validation or display SF information in the side panel, you will need to create a custom email component within Salesforce.

  • are we can't access messageBody attribute in component init function?
    – sdandamud1
    Jun 28, 2019 at 19:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .