Skip to main content

Create a Preview Screen and Send Email Action

Build a Way to Preview Your Email

Now that you set up your email template, add a way to preview it before you send it. While you could set this email to send without a preview, you want to do a final check to make sure all the details are correct before it goes out.

To do this, add another Screen element.

  1. Click Add element () after the Get Opportunity Get Records element.
  2. Select Screen in the Interaction section.
  3. In Screen Properties, enter these details:
    • Label: Email Preview
    • API Name: Email_Preview (This should automatically generate.)
    • Description: Shows the user a preview of the email before sending it.
    • Configure Header: Deselect Show Header.
    • Configure Footer:
      • Next or Finish Button: Use the standard label, the default
      • Previous Button: Hide Previous
      • Pause Button: Hide Pause
  1. Like on your first screen, use a Display Text component. Click and drag Display Text from Components onto the New Screen canvas. Enter these details:
    • API Name: displayEmailBody
    • Click in to the Insert a resource… search bar, then find and select the emailBody text template. This should add {!emailBody} to the text field.
    • Click into the text field after {!emailBody} and hit the return key twice.
    • Add this guidance to the text box: READY TO SEND THIS EMAIL? If so, click Next. If not, make adjustments to the Opportunity and Primary Contact records and refresh the page.
    • Optionally, you can style the guidance text so it doesn’t blend in with the email body. Make the guidance text bold.
      The New Screen interface with the Display Text component configured
  1. Click Done.

The new Screen element in the flow

Click Save in Flow Builder.

Create an Action to Send the Email

Now it’s time to send the email.

You’ll use the Action element. Salesforce provides several standard types of actions under the Action element, like submitting a record for approval, posting to Chatter, sending a survey, and sending an email.

  1. Click Add element () after the Email Preview Screen.
  2. Select Action in the Interaction group.
  3. Click into the Search all actions… search bar, then find and select Send Email (emailSimple-emailSimple).
    Send Email in the Action search
  4. Label: Send Email
  5. API Name: Send_Email (This will generate automatically.)
  6. Description: This element sends the email.
  7. Body: Enable and select the emailBody text template. {!emailBody} will appear in the field.
  8. Subject: Enable and enter Thank you for your gift to No More Homelessness! You could also use values from a resource or variable, but let’s keep it simple for now.
  9. Recipient Address List: Enable and find and select Opportunity from Get_Opportunity, then npsp__Primary_Contact__r (Primary Contact), then Email so that {!Get_Opportunity.npsp__Primary_Contact__r.Email} appears in the field.
  10. Rich-Text-Formatted Body: Enable and find and select $GlobalConstant.True so that {!$GlobalConstant.True} appears in the field. This tells the Action that you want to format the email body as rich text.
  11. Sender Address: Leave this toggled off to Don’t include and the email will come from the address of the account running the flow. In your Trailhead Playground, that will be the email you use for Trailhead.
  12. Click Done.
  13. Save the flow.
Note

You may get an error message about the format of the email address. You can ignore this for now.

The new Action element in the flow

Now you are set up to send the email. But hold on, because there are a few more elements to add in order to make the most of Salesforce and Nonprofit Success Pack (NPSP). When you send the email you also want to change a few fields on the opportunity record to show that the gift has been acknowledged. You dive into that in the next step.

To complete this step and move on, launch your Trailhead Playground and click Verify to check that your Email Action is configured properly. 

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities