• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

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!
0
selms
Asked:
selms
  • 3
  • 2
  • 2
1 Solution
 
SidFishesCommented:
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>


0
 
selmsAuthor Commented:

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!!
0
 
SidFishesCommented:
ahh..oops...sorry didn't quite understand your original q.

you -are- missing something...specify the TYPE attribute


<CFMAIL FROM="webmaster@mysite.com"
              TO="#form.email#"
              SUBJECT="Thank you for submitting our form!"
              TYPE="HTML">
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
RCorfmanCommented:
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>
0
 
RCorfmanCommented:
You could even include a preference on the form for html vs text emails...
0
 
selmsAuthor Commented:

SidFishes

IT WORKED!!!!

THANKS!!!!!!!
0
 
SidFishesCommented:
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#

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now