Web to Lead Implementation
In my last blog, I spoke about the objects that I'll be using in my implementation. I have still not concluded on the data model. But, one object that I'll be needing for sure in my requirement is Lead.
In this blog of mine, I'll be discussing about one practical implementation for any business that includes Sales. In any business that needs a lot of groundwork like meeting potential leads, it's very important to have a process to track the closure of the lead.
In this case, a nice to have feature would be - As soon as the Sales person meets a potential client, he would just enter the details on ground, in some sort of a form, which would create a lead in Salesforce. This would trigger a after insert trigger logic which would send out some form of communication like an email / whatsapp message / a text with a Thank you note and the details of the website where orders can be placed or details about the company could be shared.
So, keeping things simple, I started by creating a web to lead form on Lead.
To do that:
- Navigate to Setup > Marketing > Web-to-Lead.
- Click on "Create Web-to-Lead Form" button.
- Select the fields you'd want to display in your form.
- An HTML Code will be generated. Copy and save it in a HTML page that you create. This is my code for Web-to-HTML form
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="[ORG_ID]">
<input type=hidden name="retURL" value="https://lovedoo.carrd.co/">
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>
<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br>
<label for="city">City</label><input id="city" maxlength="40" name="city" size="20" type="text" /><br>
<label for="state">State/Province</label><input id="state" maxlength="20" name="state" size="20" type="text" /><br>
<br>
<input type="submit" name="submit">
</form>
This is how my Web-to-Lead form looks like. It's very basic as of now.
On entering the details in this form and on clicking on "Submit", the lead gets created in Salesforce.
I my upcoming blogs, I'll make this Web-to-Lead form global and also have a Trigger logic which would trigger a communication to the customers.
Stay tuned for some more exciting implementations.