[ExerciseIntro ]
[RCNotLoggedInNotAdmin]
[/RCNotLoggedInNotAdmin]
[RCAdmin]
In this exercise, we are going to configure lead assignment rules, auto-response rules, and a sample web-to-lead form. We will use the example referenced in previous articles, by adding a “Type” custom field to lead containing values ‘Service’ and ‘Product’. Depending on which value is present when a web-to-lead form is submitted, a different response will be sent to the submitter.
[sc:ExerciseSteps ]
Step 1. Create the “Product Interest” field.
- Navigate to Setup –> Customize –> Leads –> Fields.
- Click New.
- Select Picklist. Click Next.
- Enter field label “Type”.
Enter picklist values:
Product
Service
Click Next. - Click Next.
- Click Save.
Step 2. Create Email Template Folder
- Navigate to Setup –> Communication Templates –> Email Templates.
- Click “Create New Folder”.
- Enter label “Lead Response Templates”.
Select “This folder is hidden from all users” (otherwise users will be able to select auto-response email templates for regular email use).
Click Save.
Step 3. Create Email Templates
The “Lead Response Templates” folder should now be selected.
Creating the General Response Template:
- Click “New Template”.
- Click Next.
- Check “Available for Use”.
Enter Email Template Name “General Inquiry Response”.
Enter Subject “Thank you for inquiring. We will be in touch shortly.”.
Enter Email Body:Dear {!Lead.FirstName,Sir or Madam},Thank you for your interest in {!Organization.Name}. We look forward to working with {!Lead.Company, your company}. Someone from our team will follow up with you shortly.Sincerely,{!User.Name}
{!Organization.Name}
{!User.Email} - Click Save.
- Click “Lead Response Templates” to return to the folder:
Creating the Product Response Template:
- Click “New Template”.
- Click Next.
- Check “Available for Use”.
Enter Email Template Name “Product Inquiry Response”.
Enter Subject “Thank you for inquiring. We will be in touch shortly.”.
Enter Email Body:Dear {!Lead.FirstName,Sir or Madam},Thank you for your interest in {!Organization.Name}. We look forward to working with {!Lead.Company, your company}. You will be receiving a product brochure in the mail shortly.Sincerely,{!User.Name}
{!Organization.Name}
{!User.Email} - Click Save.
- Click “Lead Response Templates” to return to the folder.
Creating the Service Response Template:
- Click “New Template”.
- Click Next.
- Check “Available for Use”.
Enter Email Template Name “Service Inquiry Response”.
Enter Subject “Thank you for inquiring. We will be in touch shortly.”.
Enter Email Body:Dear {!Lead.FirstName,Sir or Madam},Thank you for your interest in {!Organization.Name}. We look forward to working with {!Lead.Company, your company}. A services consultant will be in touch shortly to discuss your needs.Sincerely,{!User.Name}
{!Organization.Name}
{!User.Email} - Click Save.
- Click “Lead Response Templates” to return to the folder.
You should now have 3 templates:
Step 4. Create Queues
Create the Product Sales Queue:
- Navigate to Setup –> Manage Users –> Queues.
- Click New.
- Enter Label “Product Sales”.
Assign the lead object to the queue:
- Click Save.
Create the Service Sales Queue:
- Navigate to Setup –> Manage Users –> Queues.
- Click New.
- Enter Label “Service Sales”.
Assign the lead object to the queue. - Click Save.
Step 5. Configure a Lead Auto-Response Rule
Create the Auto-Response Rule:
- Navigate to Setup –> Customize –> Leads –> Auto-Response Rules.
- Click New.
- Enter Rule Name “Default”.
Check “Set this as the active Web-to-Lead Auto-Response Rule”.
Click Save.
- Click “Default” to view and edit the rule.
Add the Product Auto-Response Rule Entry:
- Click “New” under Rule Entries.
- Enter Sort Order 1.
Select Lead: Type equals Product.
Enter a Name and Email Address (e.g. no-reply@gmail.com).
Select the “Product Inquiry Response”.
Click Save.
Create the Service Auto-Response Rule Entry:
- Click “New” under Rule Entries.
- Enter Sort Order 2.
Select Lead: Type equals Service.
Enter a Name and Email Address (e.g. no-reply@gmail.com).
Select the “Service Inquiry Response”.
Click Save.
You should now have two rules entries within an active rule:
Step 6. Edit Web-to-Lead Settings
- Navigate to Setup –> Customize –> Leads –> Web-to-Lead.
- Click Edit (You may need to first enable web-to-lead).
- Ensure that you are listed as the Default Lead Creator.
Set the Default Response Template to “General Inquiry Response”.
- Click Save.
Step 7. Create Lead Assignment Rule
- Navigate to Setup –> Customize –> Leads –> Assignment Rules
- Click New.
Enter a name (e.g. “Default”).
Check “Set this as the active lead assignment rule.”
Click Save.
Click on the “Default” rule. - Click “New” to create a new rule entry.
Enter Sort Order “1”.
Lead Type equals “Product”
Queue “Product Sales”
Click Save & New. - Enter Sort Order “2”.
Lead Type equals “Service”.
Queue “Service Sales”.
Click Save.
(Leads that are not Type “Product” or “Service” will be assigned to the default lead creator.)
Step 8. Create a Web-to-Lead Form
- Navigate to Setup –> Customize –> Leads –> Web-to-Lead.
- Click “Create Web-to-Lead Form”.
- Add the “Type” field to the list.
Click “Generate”. - Copy the Web-to-Lead Form into a text editor:
- Save the file as a .html file.
[sc:ExerciseSuccessCriteria]
Open the file created in the previous step in a web browser. Submit the form 3 times, with a valid email address:
Submission 1. Type = “Product”
Ensure results:
- Lead Owner: Product Sales Queue
- Email Reply: Product Response Inquiry
Submission 2. Type = “Service”
Ensure results:
- Lead Owner: Service Sales Queue
- Email Reply: Service Response Inquiry
Submission 3. Type = –None–
Ensure results:
- Lead Owner: You (or otherwise if web-to-lead settings changed)
- Email Reply: General Response Inquiry
[/RCAdmin]
Step 5. Configure a Lead Auto-Response Rule
1. Navigate to Setup –> Customize –> Leads –> Lead Auto-Response Rules.
3. Enter Rule Name “Default”.
Check “Active”.
Step 7. Create Lead Assignment Rule
Click New.
Enter a name (e.g. “Default”).
Check “Active”.
Everything worked fine except the formula in the email body doesn’t seem to work, {!NullValue(Lead.Company, “your company”)}. Instead it inserts “[not provided]”.
Yeah the nullvalue check on company name is a bad example, as SFDC will auto populate [not provided] for company name as it is a required field. I’ll update the materials next go around.
You might want to change the information on the From email address in the Auto-Response rule definition. You can’t put just any email there: “Error: noreply@gmail.com is an invalid From email address. The sender email address must be either one of your verified organization-wide email addresses or the email address in your Salesforce user profile.”. This is actually quite unfortunate since in these auto-replies companies often would want to put a dummy email address so people can’t actually reply to them.
Interesting I think that’s a new validation. Thanks for the heads up
Hi John,
I am new to SFDC. In this example, after submitting lead, is there a way to show a message “Your information is submitted” like that in SFDC itself?
You’d put that message on the page that your redirect points to
Hey John ,other experts
So I created an auto response rule and also assigned different email templates to my assignment rules. Basically created a clash to find which email template is used in this situation. Figured out that the auto response rule wins. The email template used was that of the auto response rule and not the one directly assigned in the assignment rule. Hope that’s correct?
Goes like this:
First ACTIVE web-to-lead rule entry (based on order #) with criteria met.
If no criteria met, use general response template (configured in web-to-lead in setup)
This is a great training resource.
One question, it worked for 2 of the 3. I got a response for Product Inquiry and Service Inquiry, but not the General Inquiry. Where do we specify the email template for the Default?
Thanks,
Kim
setup –> web-to-lead
John,
I am stumped on this one. I have tried everything and my leads get assigned to the default owner and not to the queue. I followed your steps exactly. I checked the debug logs and it appears the assignment rule is not assigning the lead to a queue – The owner is shown as blank and its reassigned to the default owner.
I’m not sure why this is occurring – any ideas?
How are you creating the lead? If it is through the user interface then you need to select the checkbox to initiate lead assignment (there is an option on the page layout to expose it)
Dear John,
Your training system is so valuable. I’ve been using it for over a month, but today when my exercise worked on the first try, I broke into a big smile for the first time during training. Just wanted to share a little joy.
Thank you,
Theresa
Awesome 🙂 thanks for sharing Theresa
Hi John, everything looks right ( email templates, auto responses rules, lead assignment rules and web to lead form ). However, I did not receive any email. Any thoughts? Many thanks, -Crystal
Did the lead get created with the correct email address? Did you check your spam folder? Those are the common ones 🙂
Check your “Deliverability” setup.
Go to Setup, Deliverability and chose All email at “Access level”.
Hi John,
I created a WTL form as well as 3 email templates (general (default) /product / service inquiry) + an auto-response rule with 2 rule entries for product and service inquiries based on your exercise above.
However when I leave the company field blank on the web form, in my auto-response email I receive company as not provided, see below:
“We look forward to working with [not provided].”
Whereas if I leave first name and last name blank I receive it correctly:
“Dear Sir or Madam,”
Here is the Email Template text.
Dear {!NullValue(Lead.FirstName, “Sir or Madam”)},
Thank you for your interest in {!Organization.Name}. We look forward to working with {!NullValue(Lead.Company, “your company”)}.
You will be receiving a product brochure in the mail shortly.
Sincerely,
{!User.Name}
{!Organization.Name}
{!User.Email}
Any thoughts? Thanks a lot, Soraya.
The company name field is required on lead, therefore it is getting auto populated: https://help.salesforce.com/apex/HTViewSolution?id=000171026&language=en_US
Good Q!
Thanks a lot John, that explains it!
Yes, I retested from another computer.
So everything is working now?
I have tested the web to lead page as described but the response from the system is as follow:
Salesforce.com Lead Capture Interface
Reason: Your Lead could not be processed.
null
Lead Capture Page: Not available.
Record Information:
00N1a000006ecb4 = Service
city = San Jose
company = People at work
debug = 1
debugEmail =
email = jason.peoples@hotmail.com
encoding = UTF-8
first_name = Jason
last_name = Peoples
oid = 00D1a000000JnGg
retURL = http://
state = Ca
submit = Submit Query
If you have any questions, please click on Help & Training at the
top right of any page within salesforce.com
The Capture page is not available?
I was able to find the answer to the question from a blog I found on the web. It indicated to add the instance name to the html. Instead of entering https:/test.salesforce.com I changed the value to https:/na24.salesforce.com which resulted in a successful record processed.
Your request has been queued.
Record Information:
00N1a000006ecb4: Service
city: Cupertino
company: Hunter Industries
debug: 1
debugEmail:
email: larry.hunter@yahoo.com
encoding: UTF-8
first_name: Larry
last_name: Hunter
oid: 00D1a000000JnGg
retURL: http://
state: California
submit: Submit Query
The shows as queued, Is there still a problem with the code? I am working from a developer org. I understand there is a limit of 500 record per day max.
Did the request get processed?
John, I have checked both Product and Service. I will turn on the debug then next try and see if I can find anything via the debug logs. I will keep you posted.
Fred
Hi John,
What would be the {!User.Name} populated with in the auto response email if the lead is assigned to a Queue ?
I would have to test that out, feel free to try it and post to let us know. I think it would be blank (although it may be the name of the queue).
If the lead is assigned to a queue, the {!User.Name} populated with the auto response rule mentions the Default Lead Creator’s name.
Awesome thanks for the update
Hi John
I created the web to lead form and Auto response email. I can see the lead in Salesforce and the activity history shows that an email was sent to the email id specified in the form. But I have not received any email at that email id. Am I missing something?
There is a settings that would prevent the email from being sent (sandboxes can turn off outbound email for example, check email deliverability in setup) – any chance spam filter could have been the issue?
Hi John. I have the following questions related to the above exercise:
1. In the email template, from where does the system take the User Name mentioned in the signature of the email?
2. When the lead is created, from where does the system take the “created by” and “modified by” names?
Do both of the above come from the “Default Lead Creator” field on the Web-to-lead page?
Correct – default lead creator
I am using windows 8 with notepad but when I try to open the HTML file it simply leads back to this page – any ideas where I may be going wrong?
Are you copy/pasting code from Salesforce generated from your salesforce org web-to-lead into notepad?
Yes I am.
I would check your file associations on your computer to ensure that the html file is being opened by a web browser- I would then try to open as with another web browser (e.g. chrome).
Hi John,
I have a question. You have mentioned that (Leads that are not Type “Product” or “Service” will be assigned to the default lead creator.) Will they be assigned to the default lead creator mentioned in the web-to-lead settings or the default lead owner in the lead settings ? Isnt ‘default lead creator’ the one who will be mentioned only in the ‘Created by’ field of the lead and not in the ‘Lead owner’ field? Thanks .
Default is this context refers to the web to lead default lead creator setting in web to lead configuration, and would only apply to web to lead created leads.
If a lead was created manually (with no other workflow rules, triggers, etc. present), then the lead creator would also become the lead owner.
I had this same question and the answer John gave below still made me confused. So I tested this and here is what I experienced. Let’s say a new lead is created via Web-to-Lead and did not match one of the existing assignment rules. The new lead will be created in SF.com and the “Created By” field will have the “Default Lead Creator” (which is specified under ‘Web-to-Lead Settings) and the “Lead Owner” field will have the “Default Lead Owner” (which is specified under Leads > Settings.
Thanks for the clarification Rosalin
John,
I think it will be helpful to include a couple of tweaks if testing on a sandbox:
1) On the sample HTML that gets pasted on the notepad, please make sure to change the “www.salesforce.com” to “test.salesforce.com” on form tag
2) Make sure to point the Org Id to the sandbox (on the next line in the HTML)
Though they seem to be evident, sometimes we tend to overlook these minor changes.
on second point, I meant this line
Thanks,
Thripura
Good point, thanks Thripura
The text versions of the e-mail templates are not correct. The versions shown in the images are correct. The correct merge field for the signature is {!User.Name}, not {!User.FullName}. Also, should the e-mail template be entered when creating the lead assignment rule?
Thanks Kevin – not sure how that got mixed up. Updated.
Specifying the email template in the assignment rule is what is sent to the lead owner – the auto-response rule sets the email sent to the submitter of the lead form.
Troubleshooting tip for Macs:
You have to use TextEdit in lieu of Notepad. When you open TextEdit, go to ‘Format’ > ‘Make Plain Text’. Next, copy in the code provided by SF. When you save, manually add the .html extension. Rather than opening the file in the web browser you can open it through Finder and it will open the file through your default browser.
Thanks cooper
I can’t seem to get the web to lead form to generate in my browser. Here is exactly what I took out of my auto-generated html:
https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8” method=”POST”
Any thoughts? I also tried https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8 just in case but that went nowhere either. Thank you!!
Hi Ann- I would try it again, and make sure to use notepad (Word and other editors will add formatting to the file, corrupting it) to paste in the code contents.
Did you try multiple browsers?