Forums / Managing Customers and Orders / Send email to address entered in promo code or coupon field

Send email to address entered in promo code or coupon field

Started by butterballz on 27 Feb 2013, 7:19 PM · Views: 1,159

Results 1 to 2 of 2
27 Feb 2013, 7:19 PM
#1
butterballz avatar

butterballz

New Zenner

Join Date:
Feb 2013
Posts:
1
Plugin Contributions:
0

Send email to address entered in promo code or coupon field

I am using promo code's that are actually valid email addresses. When a successful payment has been made, and a promo code was used, I would like to send an email to the email address (promo code)....

For example, if someone entered the coupon or promo code '[email protected]' then upon successful payment confirmation, I would like an email sent out to the email address entered within the promo code field. I don't mind hard coding the message.

I know how to validate if the email is correct, but I am having trouble figuring out where this code would go so that it fires upon a successful payment confirmation when it detects an email address has been entered in the promo/coupon field. I thought that I could put it in the salemaker.php file but can't seem to find any references as to what promo code the user may have entered.

Thanks for any assistance in pointing me in the right direction!

1 Mar 2013, 12:03 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Send email to address entered in promo code or coupon field

Simply write an observer class to hook the NOTIFY_ORDER_AFTER_SEND_ORDER_EMAIL notifier point, and have that class look at the $_SESSION['cc_id'] which is the coupon code, and take the desired action.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.