[SalesForce] Sending Email from a Lightning Component

I know it's possible to use server side Apex to send out emails but not sure about Lightning Component. I have a lightning component which contains a list of users and the associated "Email this person" buttons so I was wondering if you have any suggestions to trigger the buttons to send a template email to the selected address.

Thank you very much

Best Answer

If you want to have something from Lightning components trigger an email, you have some options.

Workflow

When a record is saved, you can use a workflow rule to trigger sending an email. If the save is done as a result of your component, then great. It still works.

Apex

Here you don't have to depend upon a record save. You can arbitrarily send email. But you are required to abide by the maximum outbound email limit.

Callout to External Email Service

Again, this is via Apex, but instead of using our email service, you could make a callout to an external email provider.

In the end, none of these really has anything to do with Lightning Components. Nor should they. Lightning Components is a client-side Javascript component framework. It runs in the browser/web view.

Related Topic