Skip to main content
欢迎参加 3 月 5 日至 6 日在旧金山举行的 TDX AI 代理时代开发者大会,或通过 Salesforce+ 参与。立即注册

Create Your Email Template

Learning Objectives

In this project, you’ll:

  • Create a welcome message email template for program participants.
  • Build a flow to send a templated email to all active program participants in the same program cohort.
  • Add a quick action to run your flow from the program cohort page layout.
  • Test your flow.
  • Consider how you can change this simple flow to use it for your organization.
Note

This project provides information about Program Management Module (PMM), a managed package. For information about platform solutions, see the Manage Programs with Nonprofit Cloud trail. If you’re not sure which solution your organization uses, check with your Salesforce admin.

Before You Start

Before you complete any steps in this module, make sure you complete the hands-on challenges in Set Up a Program Management Module Trial for Trailhead using the same Trailhead Playground. The work you do in the hands-on challenges here builds on the work you complete in that badge. 

Also, consider completing the following recommended content.

Automate Emails to Your Program Participants

Program Management Module (PMM) gives your organization objects and tools to manage your programs and services. It's a foundation on which you build program data and processes in Salesforce. It comes with ready-to-use reports and dashboards that you can use to make data-driven decisions to further your mission.

How can you make it even better? By building in automation to help your users.

In this project, you use Flow Builder to create a simple flow that sends a templated email to every program participant with an active program engagement in the same program cohort. The flow operates using a quick action on program cohort records, so users can send a welcome email.

The finished flow

Let’s get started!

Make the Choice Between Email Templates and a Text Template Within Flow Builder

When you build a flow that sends an email, you first decide how you want to create the email template. There are two primary options: Using the Email Template object or building the template within Flow Builder using a Text Template resource.

There are advantages and drawbacks to each option, which we weighed and decided to use the Email Template object in this project. This approach provides two advantages.

  • Anyone in your organization with access to the email template record can edit and revise the template as your requirements change. Your users can change the template without editing the flow.
  • You can only save 50 versions of an activated flow. Using an email template means you can make changes without saving a new version of the flow, reserving your flow revisions for new features or enhancements.
Note

If you want an example of using a text template resource to send an email with flow, check out the Build a Donor Email Flow for Nonprofit Success Pack (NPSP) project.

Make Program Engagement Records Available to Email Templates

Now that you know you’ll use an email template, make sure that the objects you need are properly configured.

You first reference fields from the Program Engagement object in your template, so check that it’s available to be related to an email template. To do this, allow activities on the Program Engagement object.

  1. From Setup, click the Object Manager tab.
  2. Find and select Program Engagement from the list.
  3. Click Edit on the Details page.
  4. In the Optional Features section, make sure that Allow Activities is selected. If you have to select the setting, click OK on the alert message to confirm your choice.
  5. Save your work.

Create Your Email Template

Now let’s create the email template. You don’t do this in setup—Email Template is an object of its own.

  1. From the App Launcher (), find and select Email Templates.
  2. Click New Email Template.
  3. In Email Template Name enter Program Participant Welcome (Cohort).
  4. In Related Entity Type, select Program Engagement.
  5. In Description, enter Template to welcome participants to a program and cohort. For use in flow.
    Always fill in description fields with details that'll help you remember how you are using something. Your future self will thank you.
  6. In the Folder field, select Public Email Templates.
  7. In Subject, enter Welcome to the {{{pmdm__ProgramEngagement__c.pmdm__Program__c}}} program.
    The text in brackets is called a merge field, and it pulls information from the program engagement record for display.
  8. Enter the content of the email. You can begin typing directly into the HTML Value field and use the rich-text formatting tools. Plus, you can click Insert merge field to find and select information from the program engagement record or details about the recipient, sender, or organization. Explore the Insert Merge Field options if you’d like, but we did all the hard work for you here. Cut and paste this information into the HTML Value field and format it how you like.
    Dear {{{pmdm__ProgramEngagement__c.pmdm__Contact__c}}},
    Welcome to the {{{pmdm__ProgramEngagement__c.pmdm__Program__c}}} program at NMH. We're happy that you'll be joining us.You are enrolled in the {{{pmdm__ProgramEngagement__c.pmdm__ProgramCohort__c}}} cohort.Expect more information about the program soon. Please reach out directly to me if you have any questions.
    Thank you,
    {{{Sender.Name}}}
    {{{Sender.Email}}}
  9. Save your work.

Set Up an Email Alert

With the template created, you can now set up an email alert to use the template. Email alerts are emails generated by an automated process and sent to designated recipients. The email alert you create here will be in place for later, to connect your email template with a flow.

  1. From Setup, in the Quick Find box, enter email alerts, and then select Email Alerts.
  2. If you’re sent to the Understanding Workflow page, click Continue.
  3. Click New Email Alert.
  4. In the Description field, enter Send Email to Program Participants (Cohort). Unique Name should populate automatically as Send_Email_to_Program_Participants_Cohort.
  5. In the Object field, select Program Engagement.
  6. To select the Email Template, click Email Template Lookup and then:
    • Click Classic and select Lightning.
    • Select Program Participant Welcome (Cohort).
  1. In the Recipient Type fields, select Related Contact in Search.
  2. In the Recipients fields, click Related Contact: Client in Available Recipients then click Add to move it to Selected Recipients.
  3. In the From Email Address field, leave the default—Current User’s email address—so that all emails come from the person who started the flow. You can also use a CC address in an alert, like a general internal mailbox or a program assistant.
  4. Save your work.

You’ve done all the foundational work you need. Now it’s time to get into Flow Builder.

But first, be sure to click Verify to check your work.

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈