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!
selmsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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>


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!!
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">

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

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

SidFishes

IT WORKED!!!!

THANKS!!!!!!!
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#

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.