Create a Flow to Add a Calendar File to an Appointment Email

Create a custom record-triggered flow to call an invocable action that adds a calendar file (.ics) to an appointment email. The attendance rate for Virtual Care appointments improves when a calendar invite is included in the appointment email.
Available in: Enterprise and Unlimited Editions with Health Cloud and a Video Calls Add-On license

Salesforce Scheduler is available for an extra cost in Lightning Experience


User Permissions Needed
To administer Video Calls: Health Cloud Video Calls permission set
To create, edit, and delete flows: Manage Flows
To add an organization-wide address: Modify All Data
  1. If a No-Reply email isn’t set up for your org, create one.
    1. From Setup, in the Quick Find Box, enter Organization-Wide Addresses, and then select Organization-Wide Addresses.
    2. Under Default No-Reply Address, click Add in the Organization-Wide Email Addresses for User Selection and Default No-Reply Use section.
    3. Enter a display name. The display name is what a customer sees as the email’s Sender Name.
    4. Enter your No-Reply email address.
    5. Select Default No-Reply Address as the purpose.
    6. Save your work.

      An email is sent to the organization-wide email address. Follow the steps in the email to verify your org’s default No-Reply address.

      Note

  2. Identify an email template ID to use with this flow.

    The email template can be a Classic Email Template or Lightning Email Template. If you don’t have an existing template, follow these steps to create one: Email Template in Lightning Experience.

    Note

    1. From Setup, in the Quick Find Box, enter Classic Email Templates, and then select Classic Email Templates.
    2. Click the name of the template.
    3. In the URL address bar for your template, find the 15 character string of numbers and capital letters that starts with 00X. Make note of this ID so that you can add it to the flow.
  3. Create a record-triggered flow.
    1. From Setup, in the Quick Find Box, enter Flows, and then select Flows.
    2. Click New Flow.
    3. Select Record-Triggered Flow.
    4. For the Object, select Service Appointment.

      The API Name is ServiceAppointment, the label is Appointment.

      Note

    5. Set the flow to trigger when a record is updated.
    6. For the entry conditions, select Any Condition is Met (OR).
    7. Enter these conditions:
      Field Operator Value
      SchedStartTime Is Changed True
      SchedEndTime Is Changed True
      StatusCategory Is Changed True
    8. For When to Run the Flow for Updated Records, select Every time a record is updated and meets the condition requirements.
    9. Set the flow to be optimized for actions and related records.
    10. Select Include a Run Asynchronously path to access an external system after the original transaction for the triggering record is successfully committed.
    11. Click Done.
  4. Add an assignment element to the flow to set the recipients of the email.
    1. Add an element by clicking flow auto layout plus sign.

      This flow can be designed to Run Immediately or Run Asynchronously depending on your business needs.

      Note

    2. Click Assignment.
    3. Add a Label. We suggest Add Recipients.
    4. Keep the default API Name.
    5. For Set Variable Values, click the Variable input text box and select New Resource.
    6. For Resource Type, select Variable.
    7. For API Name, enter Recipients.
    8. For Data Type, select Text.
    9. Select Allow multiple values (collection).
    10. Click Done.
    11. For Operator, select Add.
    12. For Value, select {!Record.Account.PersonContactID}, and that shows as ($Record > Account ID > Contact ID).
    13. Click Done.
  5. Add an assignment element to the flow for related records.
    1. Add an element by clicking flow auto  layout plus sign.
    2. Click Assignment.
    3. Add a label. We suggest Add Related Records.
    4. Keep the default API Name.
    5. For Set Variable Values, click the Variable input text box, and select New Resource.
    6. For Resource Type, select Variable.
    7. For API Name, enter Related Records.
    8. For Data Type, select Text.
    9. Select Allow multiple values (collection).
    10. Click Done.
    11. For Operator, select Add.
    12. For Value, select {!Record.ID}, and that shows as ($Record > Service Appointment ID).
    13. Click Done.
  6. Add an action to the flow to send the email.
    1. Add an element by clicking flow auto layout plus sign.
    2. Select Action.
    3. In the Action Search box, enter Send Message, and then select industriesSendMessage.
    4. Add a label. We suggest Send Message.
    5. Keep the default API Name.
    6. For Channel, enter Email.
    7. For Message Type, enter Video Call Confirmation.
    8. For Recipient IDs, select the Recipients collection variable that you created.
    9. For Template ID, enter the 15-digit email template ID you noted from the url of the email template record.
    10. For Related Record IDs, click Include.
    11. For Related Record IDs, select the Related Records collection variable that you created.
    12. Click Done.

      We suggest that you handle basic failures by creating a fault path in your flow. The industriesSendMessage action has 2 output parameters that you can check. It has a success parameter and also outputs a list of failedRecipients.

      Note

  7. Save the flow.
  8. Enter a Flow Label.
  9. Save the flow.
  10. Activate the flow.