Link to home
Start Free TrialLog in
Avatar of selms
selmsFlag for United States of America

asked on

Include tracking URL in confirmation email


I would like to a way for the user to get an email (my CFMAIL below works) with a link to their order.

The email body would read something like this:

***
Your request has been sucessfully submitted.
<bold>Click here</bold> to access your request or cut and paste this URL in your browser:

http://www.mysite.com/checkorderstatus.cfm?refid=12345
***

here's what I have so far that works:
<CFMAIL FROM="webmaster@mysite.com" TO="#form.email#" SUBJECT="Thank you for submitting our form!">
      Dear #form.firstname# #form.Lastname#,
           You have successfully submitted a request,  blah blah
     
      Submission Receipt:
      ===========================================================
      Sender name: #form.firstname# #form.lastName#
      Sender email: #form.email#
      Message Sent: #DateFormat(now(), 'mmmm dd, yyyy')# #TimeFormat(Now(), 'hh:mm:ss tt')#
     
    </CFMAIL>

how do I include the URL ????????

Thanks!
Avatar of SidFishes
SidFishes
Flag of Canada image

SOmething like this

<CFMAIL FROM="webmaster@mysite.com" TO="#form.email#" SUBJECT="Thank you for submitting our form!">
      Dear #form.firstname# #form.Lastname#,
           You have successfully submitted a request,  blah blah
     
      Submission Receipt:
      ===========================================================
      Sender name: #form.firstname# #form.lastName#
      Sender email: #form.email#
      Message Sent: #DateFormat(now(), 'mmmm dd, yyyy')# #TimeFormat(Now(), 'hh:mm:ss tt')#

Your request has been sucessfully submitted. <a href="http://www.mysite.com/checkorderstatus.cfm?refid=#refID#.html">
<span style="font-weight:bold"> HERE</span></a>to access your request or cut and paste this URL in your browser:
<br>
<a href="http://www.mysite.com/checkorderstatus.cfm?refid=#refID#.html">http://www.mysite.com/checkorderstatus.cfm?refid=#refID#.html</a>    

    </CFMAIL>


Avatar of selms

ASKER


Am I missing something?   .... Does it need to be wrapped in something else??

The #firstName# #LastName is displaying properly, but the href is not in a hyperlink format.


      Dear Test User,

           Your request has been sucessfully submitted.
     
      Submission Receipt:
      ===========================================================
      Sender name: Test User
      Sender email: testuser@yahoo.com
      Sender IP: 127.0.0.1

      Message Sent: March 23, 2006 04:12:14 PM
     
        
        Your request has been sucessfully submitted.
<a href="http://localhost:8500/travelapprover/webroot/myAccount.cfm?UserID=1.html">
        
<span style="font-weight:bold"> HERE</span></a>to access your request or cut and paste this URL in your browser:
<br>
<a href="http://localhost:8500/travelapprover/webroot/myAccount.cfm?UserID=1.html">http://localhost:8500/travelapprover/webroot/myAccount.cfm?UserID=1.html</a>  
        
   
***

Please help... thanks!!
ASKER CERTIFIED SOLUTION
Avatar of SidFishes
SidFishes
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RCorfman
RCorfman

Or, if you want to send text emails, just include the http:// address. Some email clients will readily recognize the http:// as a URL and when they click on it, even in a text email, it opens.

Outlook works that way.... even with a plain text email, just include the url and away you go.

<CFMAIL FROM="webmaster@mysite.com" TO="#form.email#" SUBJECT="Thank you for submitting our form!">
      Dear #form.firstname# #form.Lastname#,
           You have successfully submitted a request,  blah blah. To view your request, click the following link:
     http://www.mysite.com/checkorderstatus.cfm?refid=#form.refid#
     
      Submission Receipt:
      ===========================================================
      Sender name: #form.firstname# #form.lastName#
      Sender email: #form.email#
      Message Sent: #DateFormat(now(), 'mmmm dd, yyyy')# #TimeFormat(Now(), 'hh:mm:ss tt')#
     
    </CFMAIL>
You could even include a preference on the form for html vs text emails...
Avatar of selms

ASKER


SidFishes

IT WORKED!!!!

THANKS!!!!!!!
or you could send both and let the user's client decide...which is the best way of doing it


<CFMAIL FROM="webmaster@mysite.com"
              TO="#form.email#"
              SUBJECT="Thank you for submitting our form!"
              >
              <cfmailpart type="text"   wraptext="74">
                            <cfset crlf = chr(13)&chr(10)>
                            <cfinclude template="../dsp/dsp_textMailConf.cfm">
              </cfmailpart>  

              <cfmailpart type="html">
                            <cfinclude template="../dsp/dsp_htmlMailConf.cfm">
              </cfmailpart>
</cfmail>

note that using this method you -don't- specify TYPE as you are sending both

I use a cfinclude to keep the code easier to read but you could put all the code for your mail in between the cfmailpart tags

the crlf variable is to put a line break in the text email and is used in the textMailConf.cfm like so

Thank You For Your Request.#crlf#

  Sender name: Test User#crlf#
      Sender email: testuser@yahoo.com#crlf#
      Sender IP: 127.0.0.1#crlf#