Using Legacy Workflows to Automatically Respond to a Lead Created Via Web-to-Lead Form
Overview
This article documents how to automatically send an email to a lead that is created from a web-to-lead form. This workflow will also work for when leads are manually entered into SugarCRM that meets the criteria specified in the workflow condition.
Prerequisites
- You must be an administrator or have developer-level access in Sugar to create workflows.
- An alert email template already exists. For more information on creating alert email templates, please refer to the Creating an Alert Email Template for Workflows article.
- System email settings are configured in Admin > Email Settings.
For more information, please refer to the Workflow Management and Email documentation.
Steps to Complete
In this example, the workflow looks for newly created leads with the "Lead Source" field set to "Campaign". When a new lead is created that has the lead source of "Campaign" an email welcome letter will be sent to the lead. Please refer to the Adding Lead Source as a Hidden Field to Web-to-Lead Forms article for more information. From the Admin page, scroll down to the Developer Tools section.
- Click on the Workflow Management link.
- On the left-hand side, click on "Create Workflow Definition".
- Enter the name of the workflow. For example, "Web to Lead Welcome Email".
- Complete the following fields and then click Save:
- Execution Occurs : When record saved
- Status : Active
- Target Module : Leads
- Applies to : New Records Only
- Processing Order : Alerts then Actions
- Under "Conditions", click the Create button.
- Select "When a field in the target module contains a specified value".
- Click the Next button.
- Click the "Specific Field" link.
- Within the popup window, select "Lead Source Equals Campaign".
- Click "Save".
- Click "Save" again.
- Under "Alerts", click the Create button.
- Enter the name of your Alert (this name is not sent to your customers), for example, "Lead Welcome Alert", and then complete the following fields:
- Alert Type : Email
- Source Type : Custom Template
- Select your Custom Template in the dropdown list.
- Save.
- Under "Alert Recipient List", click "Create".
- Select "Recipient associated with the target module".
- Click "Next".
- Check the checkbox for "Select custom email and name fields"
- For the Email field, select "Email" and click "Save".
- For the Name field, select "Name" and click "Save".
- For the address type, select "To:" and click "Save".
- Click Save again.
Application
You have just created an alert and defined its recipients. Now you are ready to test your workflow.
- Create a test lead that has an email address that you have access to and set the Lead Source to Campaign.
- Click the Save button.
The welcome email should have been sent to the test lead.