24 Oct Send an Email using Workflow!
Workflows in Salesforce are a fantastic way to automate certain business processes. You can create a rule, and based on certain criteria that you set, Salesforce can do a number of things, like send an email, create a task, or update a field.
Creating a workflow rule
In order to create a workflow rule, you need 2 things:
- Criteria that cause that rule to run (in this case, when a person’s lead score hits a certain number)
- Actions that execute when a record matches the criteria (in this case, an email alert)
Navigate to Your Name > Setup > Create > Workflow & Approval > Workflow Rules.
Select “New Workflow Rule” and then select the object you want the rule to apply to. We are interested in leads.
Name your rule, and give it a description. I named my rule “Act-On Lead Score Email Alert,” and described it thusly: “Send an email alert when a lead’s Act-On score exceeds 50.”
Next, decide on your evaluation criteria. There are 3 options here.
Salesforce will evaluate the rule when a record is:
2. Created, and every time it’s edited
3. Created, and every time it’s edited to subsequently meet criteria.
The first option will only check if the rule applies when the lead is created, which means it will ignore updates to existing leads. This definitely doesn’t apply, since we want our rule to apply to existing records.
The second option means that if the rule criteria is met, the rule will run, no matter what. Say we have a lead whose lead score is greater than 50. The rule will run when the record is edited to show that the lead score is above 50, but the rule will also run every single time that record is edited for any reason and the lead score is still above 50. This will result in an email about that lead, even after it’s already been determined that they’re a hot lead.
The third option means that the rule will run if a new record is created that meets the criteria, or if an existing record is changed from not meeting the criteria to meeting the criteria. This is the best option for our rule. If a hot lead is added as a new record, we’ll receive an alert. If a record is subsequently updated to have a lead score over 50, we’ll receive an alert only once that happens.
Next, set your rule criteria.
- Field: Act-On Lead Score
- Operator: greater or equal
- Value: 50
Click Save and Specify Action as New Email Alert
Setting up an email alert
Before selecting ‘New Email Alert’ from the workflow action dropdown menu, you will need to set up an email template in Salesforce.
Navigate to Setup > Administration Setup > Communication Templates > Email Templates. Click ‘New Template.’
Choose the type of template you want to create. There are four types of templates available:
- HTML (using Letterhead)
- Custom HTML (without using Letterhead)
- Visualforce (Visualforce is a native Salesforce development framework, which includes its own markup language that is similar to HTML)
Above the text box that says ‘Step 2. Text Email Template…’, note the section that says ‘Available Merge Fields.’ From this section, you can select fields from any object to be included in your email template. When the email is sent, these fields will be replaced with information from the designated records.
Here is what our email template looks like:
Once your email template is set up, you can finish setting up your workflow action.
Once again, navigate to the the detail page for your rule, and in the section called ‘Workflow Actions’—click Edit, and then Add Workflow Action, and select ‘New Email Template’ from the dropdown.
Enter a description for the email alert; ours is ‘new qualified lead.’ Choose the email template you set up previously. Select one or more of your Salesforce users to receive the email, and add any additional outside email addresses that should receive the alert to the ‘Additional Emails’ field. Choose your ‘From Email Address’ and then hit Save.
Activating your workflow rule
On the Workflow Rules landing page, find the name of your new rule. To the left, there should be three links: ‘Edit | Del | Activate.’ Click ‘Activate,’ and you’re finished!
“Know more about Salesforce Consulting at Techila”