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
yujohwan99yujohwan99 

"Send Email" button in lightning without javascript?

I added a button to my Opportunities that sends an email with a template and autofilled fields using javascript. However, this button does not appear in lightning since it doesn't support JS. Is there another alternative to replace this button, so I can have a visible button on both classic and lightning? 
Natraj Subramani 15Natraj Subramani 15
Please create it as lightning component or create a VF page and add the script to it. You can create a new Action from "Buttons, Links and Actions" and set it to lightning component or VF based on choice. 

On the pagelayout add the new action under "Mobile & Lightning Actions" section and custom buttons. This will make sure its available for classic and lighting.

https://trailhead.salesforce.com/en/modules/lex_javascript_button_migration/units/javascript_button_alternatives

https://developer.salesforce.com/blogs/2018/06/convert-javascript-buttons-to-lightning-friendly-alternatives-with-the-lightning-experience-configuration-converter.html

https://developer.salesforce.com/forums/?id=9060G0000005NhJQAU


Thanks
Natraj
Raj VakatiRaj Vakati
You can use QUikc actions for sening email no need of any code ..simple 

https://help.salesforce.com/articleView?id=case_interaction_send_email_quick_action_create.htm&type=5

Create the Send Email quick action.
From Setup, click the Object Manager tab. Select Cases, and open the Buttons, Links, and Actions setup page.
Click New Action.
For Action Type, select Send Email.
For Standard Label Type field, select a label for this action. When you add the action to the case page layout, this label is displayed in the actions bar.
The Name field is auto-filled. This name is used in the API and managed packages. It must begin with a letter and use only alphanumeric characters and underscores, and it can’t end with an underscore or have two consecutive underscores. Unless you’re familiar with working with the API, we suggest not editing this field.
In the Description field, describe what this quick action does. The description appears on the detail page for the action and in the list on the Buttons, Links, and Actions page. The description isn’t visible to your users. If you’re creating several actions on the same object, we recommend using a detailed description.
 
yujohwan99yujohwan99
I'm confused as to how to add my script to the VF page. Where am I supposed to enter this in? I also tried Quick Actions, but I'm unable to put it in the "Salesforce Mobile and Lightning Experience Actions" section. I can only add it to the "Quick Actions in the Salesforce Classic Publisher" section.
Jasmine Cam 25Jasmine Cam 25
Hi yujohwan99, did you ever find a solution to this? I have the exact same issue when transitioning to Lightning. 
James BuckelewJames Buckelew
I am as well. If anyone has an answer to this, please post!