How to add email notice to internet lead capture? RRS feed

  • Question

  • Hello,

    We are using internet lead capture to receive data from potential clients on our website. We need to add an email notification to the admin whenever the online for is submitted. Can someone suggest the best way to do that? Here are a couple of lines from the form that we are using:

    <form method="post" id="dl_leadForm" action="https://landingpage.leads.dynamicssite.com/PostLead.aspx?dl_lpai=ab6a7e42-a1f9-4a1b-8f3a-29e65b168189&dl_osi=50d85c09-1489-409f-8812-b318eae791ac" enctype="application/x-www-form-urlencoded" onsubmit="return validateForm()";>

    then there are all of the rows of the form... here's one line as an example:

    <label for="dl_lead.firstname_campaignresponse.firstname_">*&nbsp;First Name</label> <input type="text" id="dl_lead.firstname_campaignresponse.firstname_" name="dl_lead.firstname_campaignresponse.firstname_" maxlength="50" />

    and here is what the submit portion looks like:

    <input type="hidden" id="dl_qs" name="dl_qs" />
    <input type="hidden" id="dl_r" name="dl_r" />
    <input type="submit" onclick="document.getElementById('dl_leadForm').dl_qs.value = window.location.search;document.getElementById('dl_leadForm').dl_r.value = document.referrer;" value="Submit" />

    What I'm wondering is, how would I add an email notification to let the admin know that a validated form has been submitted?

    Currently, I have the "thank you" page set up to send her an email, but she is getting some false notices and it is creating extra work for her. The support people told us that there is not a way to do it in the work flows either.

    Thanks in advance for any help!



    Thursday, January 5, 2012 5:03 PM

All replies

  • Does the form submit successfully and create a new Lead?

    In which case could you not run a workflow based on the creation of a new lead? If you also generate Leads other ways you would want some validation in the workflow code to ignore other types (based on other fields being completed, for example, which are not available for the internet form but are available and mandatory on a "normal" Lead form, or based on the "created by" user, perhaps)

    Hope this helps. Adam Vero, MCT

    Saturday, February 25, 2012 2:58 PM
  • Betsy,

    This is a serious omission from MSFT CRM. It is unbelievable this feature is not out of the box. Unless you spend a whole lot of money for 3rd party solutions to do this for you, there is not a way to have autoreply or notification on form submissions. I have been complaining about it for over a year... :( If you have found something that works for you, I would love to hear about it! Thank you!


    --- ATS2011

    Thursday, September 13, 2012 11:04 PM
  • Hi,

    Please correct me if I am wrong or didn't understand your problem correctly. You want to send an email to admin whenever a valid lead is generated from your website. This should not be a very big issue and you can do it in two places. 

    1) In CRM workflow, whenever a new lead is generated, send out an email to admin. You can set a flag in Lead entity to check when a lead is generated from internet. Use that flag in workflow to differentiate an internet lead from other leads. This should be pretty straight forward workflow. 

    2) In you code on internet form, once user's input is validate and lead is generated, send an email after that. You might be sending emails whenever user's submits a form before his input is validated and a lead is generated. If you are thrown an error during validation or lead creation, don't send an email. This should not be a very difficult to achieve as well. 

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful" Thanks, Imran Abbasi

    Friday, September 14, 2012 12:11 AM
  • Thank you Imran!

    Unfortunately with MSCRM Internet Lead Capture, the Leads generated are not put into CRM automatically. Therefor, workflow does not apply. Because of this, if you want to respond to leads right away, you must sit in front of your screen and watch them come in - not going to happen.

    Once the user has submitted the form, it takes them to a Generic thank-you page. There is not an option to send an email. I do not know how to set it up on our website to send an email at the same time it opens the thank-you page... Is that what you are suggesting in #2?


    --- ATS2011

    Friday, September 14, 2012 12:16 AM
  • Ok, things are a bit clear now; 

    Sending out an email after a user's lead data is validated and inserted into a non-crm datasource is not a problem. Which language are you using on custom page to capture lead information from user? Here are the steps that you need to follow regardless of the language.

    1) When user press 'Submit' button, you need to write a function to validate user's input information

    2) If data is valid, insert it into destination database/file

    3) Send Email once, data is inserted into destination database/file

    4) Redirect user to Thank You Page

    Here is a sketch of what I am referring to:

    public void OnButtonClick()
      //Call Validation Function
     bool isValid =  ValidateUserInput(textbox1Value, textbox2Value);
           bool leadInserted = InsertLead();
    public bool ValidateUserInput(string value1, string value2)
      //Check input values and return true/false
       if(value1 != "" && value2 != "")
           return true;
            return false;
    public bool InsertLead()
      //Insert Code here
      //return true if lead is inserted, else return false 
    public void SendEmail()
      //send email to user here

    You can search for inserting into database or sending out email from whatever language you are using. You will get alot of examples that you can use for that. 

    I hope I was helpful.

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful" Thanks, Imran Abbasi

    Friday, September 14, 2012 9:28 AM