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
Stephanie Boggs 17Stephanie Boggs 17 

JavaScript Button to Lightning Component?

Hello,

This is currently an OnClick JS button that I have. Can this be converted into a Lightning Component?

location.replace('/email/author/emailauthor.jsp?retURL=/{!Demo__c.Id}&template_id=00XF0000001UAxV&p3_lkid={!Demo__c.Id}&p24={!Demo__c.BR_Email__c}');
Waqar Hussain SFWaqar Hussain SF
The new Lightning Experienced introduced a new way to create and manage your Email Templates.  Email Templates are now created and managed from the Email tab on the account, contact, lead and opportunity records in the new Lightning Experience UI.  Users are able to insert merge fields (1) and Load and Save Email templates (2) from within the new Lightning Experience Email Author.

IMPORTANT: Templates created via the Setup menu in Salesforce Classic are not currently available in the New Lightning Experience.  This also applies for Email Templates created in the Lightning Experience: they are not available in Salesforce Classic.

Here's the knowledge article: https://help.salesforce.com/articleView?id=000230915&language=en_US&type=1
Stephanie Boggs 17Stephanie Boggs 17
When attempting to use a global action:
  • I would like to use predefined field values, but it is not allowing me to reference any objects to pre-define the "To"
  • It also does not seem to let me pre-define the email template - unsure how to formulate that.
When attempting to use a quick action on the object:
  • There is no "Send an Email" action type to select.

The goal is to, in one click, send an email to specific users identified in existing User lookup fields on the record. This currently works in Classic using a JavaScript OnClick button but is one reason why we are not fully moving to Lightning. 
Waqar Hussain SFWaqar Hussain SF
Yes, I understand but this is what which is available for lightning. You will have to select email template and select user to send email from lightning email author.