In this lesson, we create an email template that we will use in our workflow rule and associated email alert.
Workflow Rules are created via these steps:
Select the Object
Criteria - Evaluation Criteria - Created, Created and every time it is edited, or Created and any time it’s edited to subsequently meet criteria
Rule Criteria - Criteria are met or Formula Evaluates to True
Actions - Immediate and/or Time-Based
TRANSCRIPT
---
So now we're going to start with creating an email alert tied to a workflow rule.
And the use case here is we want to send an email alert to the president whenever the sub status reaches a waiting president's signature.
Now I am going to click on the path here for awaiting president's signature. Mark that the current sub status and then one note to mention is that this old contract was under the Master record type.
We created this and created the path before we introduced record types on the Contract object.
So later we'll be creating an additional path based on record type on contracts but for now what we want to do is we want to create an email template that we'll then associate with an email alert which we'll then associate with the workflow rule so that whenever sub status equals awaiting president's signature we will send an email to the president.
So if we go into Setup you can approach this a few different ways you could start with creating the email template or you could start from the other end of things and create the workflow rule.
And I usually just start especially when you're starting out and don't have a lot populated in an instance and don't have a situation where you have a email alert that you may be able to leverage that already exists.
I usually start off with by creating a workflow rule and then specify the criteria and then create the actions to associate with that.
And if it's an email alert you need to create the email template as well so at some point we'll need to branch off and create the email template.
So I'm going to click continue and if you're new to workflow rules in general I encourage you to visit my admin course.
As far as the additional information that I have on workflow rules and email alerts I'm going to go through this fairly quickly because there's a lot of ground to cover and I just click new there and on the object we are wanting this to trigger off of the Contract object not Contact but Contract and click next and we'll complete the steps of the wizard.
It's best practice to always fill in a description so and as just a reminder we're going to use this workflow rule to send an email alert to the president whenever the sub status on a contract is awaiting president signature.
So for the evaluation criteria we want to evaluate the criteria whenever contract records are created.
And anytime it's edited to subsequently meet the criteria we don't need to check it every time it's edited.
Meaning if we were to check this then we would be sending an email alert to the president every time the contract was edited.
So for example at the sub status equal awaiting president's signature and we made some edits to other fields that would be getting an email alert every time we made an edit.
So we just want this to fire the first time that it meets the criteria that we're going to set here where the contract sub status.
Remember that's the custom field that we created previously.
And so whenever that sub status equals and we'll click the look up here to make sure that we select the correct one which is a awaiting president's signature we'll click save next.
So that's the criteria for which this will evaluate.
And then what are the actions we want to create.
And so we want to create a new email alert.
Now here is where we need the email template.
And so for now I'm just going to select a template out of the box and then we will just use that and we'll edit one of these templates I select to fit our needs.
And so here's why you may elect to create the email template first rather than the workflow rule really just personal preference.
And so I'm just going to select the first one the marketing product inquiry response template for now.
So the recipient we want to send this to the president.
And so we could select in specifying individual users and this would work in our instance here.
Alison President is the president.
Other options would be we could select Role and select whomever is in the role of President which is probably a better idea.
Because if Alison President gets canned we want her replacement to get these emails in the future and that way we're not hard-selecting an individual user ideally a lot of times as an administrator I'll fill out my own e-mails here as additional e-mail so that I'm copied on things and that is an option that you can do or you could do additional users as well.
So what I would do here so that we can test this lighter.
You can either enter your email address in the additional emails or you can select from here user and select yourself as a recipient as well.
And so Alison and myself receive these emails and the from email address will be the current user's email address.
So the email will appear to be coming from whomever triggered the workflow rule for example.
So if some other user has set the sub status to awaiting president's signature then the email alert will be coming from that user's email address.
So now I'm going to click save.
So this is my email alert.
Now we're not done yet because we need to click done here and then we need to do a few more things we need to activate the workflow rule and then we need to edit the email template.
So what we'll do at this point is we will edit the email template so you can get to that by selecting that from the email alert related list here under workflow actions and these are immediate workflow actions. We'll get into time-dependent things later before the immediate workflow action of an email alert.
We open that up and then we can select the email template by clicking here.
So what we could do is we could clone this.
Let's go ahead and clone.
Rather than editing this existing one someone a clone I'm going to call this a waiting president's signature.
And then here's an instance where I need to type this in without spaces where you could do underscores for spaces if you wish, but it doesn't update what's populated in the template unique name when you type out of it like normal.
And then you would make sure that it's available for use with this checkbox here.
You can follow your email templates in a folder and subsequently that file public classic email templates rather than of personal folders so that other users can get to it.
And for the description I will give a better description than what we were cloning from.
That relates to this email template is sent to the president to inform them that there's a contract awaiting their signature.
We've edited the template detail now we need to edit the actual body of the email.
So what we can do here and I need to change the subject as well as click at it and let's go through and change the subject.
So I'm leaving this purposefully vague here. We'll improve upon this email template later in a later lecture. But I want to show you how to just initially create this email template so we'll click save.
And if you remember we created a new email template.
We need to go back to our workflow rule in our email alert and associate this new email template with our old email alert so you can get two email alerts.
You can just search for alert here.
So it's under workflow actions just select email alerts and let me dismiss this do not show this again and click continue.
And so now if we want to go in and edit our email alarms click Edit here and we're going to select a different email template to associate with this email alert. So you can just click the Search icon to pull up all email templates and so we're going to select the awaiting president's signature and click save.
So now in the next lecture we'll put this email alert to the test.
In this lesson, we discuss how to test workflow rules and email alerts. We address setting deliverability in an org. We also discuss the email log as another way to test if your workflow rules and email alerts are working.
We then update our email template to include a clickable link to take the...
We previously created an email template and discussed the need to make the link in the email template dynamic – i.e. not hardcoded to a specific instance of Salesforce. This is because the URL link in the email template will potentially break if we are working in a sandbox environment or if our U...
We have been previously created immediate workflow actions. It’s now time for us to pivot into time-based workflow actions. These are actions that do not happen immediately, but are instead scheduled for a future date and time to fire.
We create a time-based workflow action to create a new task....