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
laxmi narayan 11laxmi narayan 11 

Onclick lightning Button

Hi there,

I want to make a custom lightning button on account object for send email to account email address.
Case: when i open a record and click on this lightning button, email send to this account record.

Thanks 
 L.N
Rounak SharmaRounak Sharma

hello Laxmi narayan,
You can have a method (@AuraEnabled)sending email 
You have to query the logged in user and in the place of emailId you have to specify user.email 
https://trailhead.salesforce.com/en/content/learn/modules/apex_database/apex_database_intro
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm
call this method on click of the lightning button
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_tag_method.htm

Please let me know if you need any help
thanks

laxmi narayan 11laxmi narayan 11
Hi Rounak,

I put (@AuraEnabled) in my apex class already.
Now, my case is that I have a Vf page for a contract, which is every time different for a new record. I need a custom lightning Button on Account object, by which i can send this contract to account record by clicking on this button.

Thanks 
L.N