Skip to main content
Inspiring
November 5, 2008
Answered

Update DB With Click of Email Link

  • November 5, 2008
  • 1 reply
  • 416 views
Here's the scenario: Visitor fills out form on website to request report. BizOwner completes report and sends Visitor an email with a link to the report. The report is based on values stored in a database. The email link looks something like this: http://www.MySite.com/freeReport/ReadYours.cfm?reportID=12345.

What I want to do is have ReadYours.cfm (the report output page) recognize when Visitor comes to the page by clicking the email link. (BizOwner views the same page after completing the report, but not by clicking the email link. BizOwner gets there from page on the site where heShe completes report. So, I don't want to record BizOwner's referral from a page on the website - just Visitor's referral from the email link.) If Visitor has arrived at the page by clicking the email link, update the database to record that Visitor has looked at hisHer report. Database has a table called "prospects", which has a column "readReport". I want to update that column/field to "yes" when Visitor gets to the report by clicking their email link.

Hope I'm making sense.

Thanks in advance,
Gwen H
    This topic has been closed for replies.
    Correct answer Newsgroup_User
    you are making sense and what you want to achieve can easily be done by
    adding some other var to the url sent to the user. then on the
    ReadYours.cfm page check for existence of that var - if it exists than
    the user has come there from a link in the email.
    i.e.

    send this link to users:
    http://www.MySite.com/freeReport/ReadYours.cfm?reportID=12345&e=1

    on ReadYours.cfm do
    <cfif structkeyexists(url, "e") AND url.e eq 1>
    <!--- visitor from email link --->
    <cfelse>
    <!--- not from email --->
    </cfif>

    another option, but not very precise, is to just check
    #cgi.http_referer# variable:
    if it contains your site's domain name then the user came from some page
    in your site;
    if not - then he/she came either from email link... or from a
    bookmark... or from a link on some other site...

    hth

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

    1 reply

    Newsgroup_UserCorrect answer
    Inspiring
    November 5, 2008
    you are making sense and what you want to achieve can easily be done by
    adding some other var to the url sent to the user. then on the
    ReadYours.cfm page check for existence of that var - if it exists than
    the user has come there from a link in the email.
    i.e.

    send this link to users:
    http://www.MySite.com/freeReport/ReadYours.cfm?reportID=12345&e=1

    on ReadYours.cfm do
    <cfif structkeyexists(url, "e") AND url.e eq 1>
    <!--- visitor from email link --->
    <cfelse>
    <!--- not from email --->
    </cfif>

    another option, but not very precise, is to just check
    #cgi.http_referer# variable:
    if it contains your site's domain name then the user came from some page
    in your site;
    if not - then he/she came either from email link... or from a
    bookmark... or from a link on some other site...

    hth

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    GwenHAuthor
    Inspiring
    November 6, 2008
    Thanks so much! That worked perfectly.

    GwenH