1

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

0

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.

| improve this answer | |
1

Are you asking if you can use Apex? If so, yes, Apex is the way that Lightning Components interact with the server. You can call a Lightning Action that maps to an Apex function, passing in the parameters to use for the email.

If this isn't what you're looking for, please provide further details.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.