Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / send duplicate order email if coupon code matches

send duplicate order email if coupon code matches

Started by erniejones on 3 Jun 2012, 3:51 PM · Views: 1,896

Results 1 to 4 of 4
3 Jun 2012, 3:51 PM
#1
erniejones avatar

erniejones

New Zenner

Join Date:
May 2009
Posts:
4
Plugin Contributions:
0

send duplicate order email if coupon code matches

Hi All - I'd like to send an additional email when a specific coupon code is used. I like to make sure my code is correct before implementing - this is a simple copy of the zen_mail line placed directly below the original, with an if statement and a hard-coded email address in /includes/classes/order.php:

if($coupon_code == "DISCOUNT4U")
{
zen_mail($this->customer['firstname'] . ' ' . $this->customer['lastname'], $this->customer["[email protected]"], EMAIL_TEXT_SUBJECT . EMAIL_ORDER_NUMBER_SUBJECT . $zf_insert_id, $email_order, STORE_NAME, EMAIL_FROM, $html_msg, 'checkout', $this->attachArray);
}

THANK YOU for any help! Ernie

4 Jun 2012, 9:36 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: send duplicate order email if coupon code matches

erniejones:

v1.3.8a
You REALLY need to upgrade your site to a secure version IMMEDIATELY.

.
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.

4 Jun 2012, 12:21 PM
#3
erniejones avatar

erniejones

New Zenner

Join Date:
May 2009
Posts:
4
Plugin Contributions:
0

Re: send duplicate order email if coupon code matches

I keep telling myself that, but I'm scared...

I'll review the upgrade forum to see if I can catch all the things that can go wrong.

But - would my email code work? Thanks DrByte.

5 Jun 2012, 3:57 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: send duplicate order email if coupon code matches

No. You're using the wrong variables.

.
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.