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

to send e-mail on click

I have a page in my application, when the user press 'pay' they ge sent to the online credit card processor.
I also wish to make an automatic e-mail be sent to them when they press pay.
the way I have it setup right now is using cfinclude, but that means that the moment they reach this page
they automatically get the e-mail although they might decied to go back and change something
how can I set this up
I imagine it would be though JS!but I don't know
thanks for the help
  • 2
1 Solution
so if pay is a link  ...  <A HREF="somepage.cfm?email=yes">pay</A>

you should notice how the query string contains the email = yes

now in your page... you use the following code

<CFIF IsDefined("URL.email") AND URL.email EQ "yes">

<CFMAIL TO="everyone@domain.com
 SUBJECT="subject title ">



<CFMAIL> http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pta.htm
How about don't send the email until they reach the confirmation page.
MMsabryAuthor Commented:
you see the page they go to after they press "pay" (which is a button) is not on my server, it is on the cc processor server.
The reason for sending this e-mail now (which I did not do before) is that orginally the system was designed to send the e-mail after they go to the processor and come back to my site, then I show the confirmation page with the payment status. But that for some reason did not work always, as I have noticed some users did not get redirected back to my page, although the information is already in the db, I did not get any notices that there have been some activity on my site. Thus I switched to this one, where they get one before they leave my site and one after
Well javascript cannot send the email message.

So how about this

Have the page submit to another one of your pages when they hit pay.  You send the email and then redirect /resubmit to where they are going to pay.  You can have the email say something like : THis is a preliminary confirmation.

Or will the CC server send them back to your site when paying is done? It sounds like it.   If so then send the email at that point with the confirmation page.

Or have a trigger/task (depending on database) that checks for new orders and sends you a message or them a message at the correct time.

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

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