---
schema_version: "1"
id: bcd0c5d08df5e6695f606c1912f07d16a0672d0aecc34c624461fae6596ee01d
title: Create an Apex Action to Send Email Notifications
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/ls_create_apex_action_to_send_emails.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.ls_create_apex_action_to_send_emails.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e471fc4f38ebfc8c70edeb80eea2f55ef8d4b0eacfbdda2d392508708f483383
description: Use the Apex class to create an Apex action that sends email notifications to unauthenticated users.
products:
  - Scheduler
  - Salesforce Platform
release: "264"
---
# Create an Apex Action to Send Email Notifications

Use the Apex class to create an Apex action that sends email notifications to unauthenticated users.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience.</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong> and <strong>Unlimited</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d63087e66">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63087e66 ">To open, edit, or create a flow in Flow Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63087e66 ">Manage Flow</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d63087e66 ">To run a flow:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d63087e66 ">Run Flows</td>

          </tr>
        </tbody>
      </table>

1. From the Elements panel, drag **Action** onto the canvas.
2. From the Filter By dropdown list, select **Type**, and then click **Apex Action**.
3. In the Action field, select **Send Email to Guest**.
4. Enter a name, such as Send Email to Guest, and an API name, such as Send\_Email\_to\_Guest for the element.
5. Set these input values:
    
    | Field | Value |
    | --- | --- |
    | appointmentId | {!$Record.Id} |
    | leadEmail | {!leadRecord.Email} |
    | leadId | {!$Record.ParentRecordId} |
6. Click **Done**.
7. Connect the Update Service Appointment Object element with this Action element.
8. Save your changes, and then activate the flow.