Forums / All Other Contributions/Addons / Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Locked

Views: 1,832

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
22 Aug 2008, 1:40 AM
#1
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Hi All,

I have just noticed in our welcome emails for new customer there is some code showing up where it tells the new customer they have a 10% discount coupon for signing up it shows up either just before or just after the code word and its TEXT_COUPON_HELP_DATE This shows up in html and plain text emails.

I have done a site wide search and found all the files this code appears in but can not for the life of me see anything missing or added ! just wondering if anyone had any suggestions I could try to solve this please :smile:

Kind Regards

Paul

If someone wants to look / sign up to see this happening our site is http://www.pandtaromaticcandles.com.au/candles

We are using Zen Cart 1.3.7

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

22 Aug 2008, 1:59 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

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

22 Aug 2008, 2:30 AM
#3
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Thanks DrByte :smile: have looked at that and will re-check all files when I find the solution I will post here for others :smile:

Kind Regards

Paul

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

25 Aug 2008, 9:20 AM
#4
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Hi all Again!

I am sorry to be so dumb at the moment but I have looked and looked and looked through every file to try and spot the problem with our welcome/new customer emails and can not find anything wrong! i can not find any white space, extra lines, wrong code and so on (well not that I can see anyway) I think it needs someone with a brain to take a look at cause my brain is frazzled :shocking:

The emails had been coming through to the customer and the admin copy just fine this started after installing Captcha v. 2.9 11.08.2008 I have also checked through all these files and could not find anything wrong. Not that I am an expert at all with php :wacko: I know the bare basic's only :( anyway this is what is showing up in the welcome emails. The text in red is the problem and i dont know where else to go from here. So if anyone has an idea as to what i need to that would be fabulous :smile:

--------HTML Emails--------------
Congratulations! To make your next visit to our online shop a more rewarding experience, listed below are details for a Discount Coupon created just for you!

As a new customer to P and T Aromatic Candles, we would like to offer you 10% off your first purchase. Simply type in the word WELCOME and this amount will be automatically deducted from your order.
To use the Discount Coupon, enter the Redemption Code code during checkout: WELCOMETEXT_COUPON_HELP_DATE

------------Plain Text Email---------------

We wish to welcome you to P & T Aromatic Candles.
Congratulations! To make your next visit to our online shop a more rewarding
experience, listed below are details for a Discount Coupon created just for
you!

As a new customer to P and T Aromatic Candles, we would like to offer you
10% off your first purchase. Simply type in the word WELCOME and this
amount will be automatically deducted from your order.

TEXT_COUPON_HELP_DATE

To use the Discount Coupon, enter the Redemption Code code during checkout:
WELCOME

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

25 Aug 2008, 9:49 AM
#5
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Hi All,

Just wondering the 2nd last line where the code . $text_coupon_help; is should that read like this . =$text_coupon_help;

This is in the module/custom/create_account php file

```php

if (NEW_SIGNUP_DISCOUNT_COUPON != '' and NEW_SIGNUP_DISCOUNT_COUPON != '0') {
$coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;
$coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");
$coupon_desc = $db->Execute("select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . $_SESSION['languages_id'] . "'");
$db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");

  $text_coupon_help .= sprintf(TEXT_COUPON_HELP_DATE, zen_date_short($coupon->fields['coupon_start_date']),zen_date_short($coupon->fields['coupon_expire_date']));

  // if on, add in Discount Coupon explanation
  //        $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .
  $email_text .= "\n" . EMAIL_COUPON_INCENTIVE_HEADER .
  (!empty($coupon_desc->fields['coupon_description']) ? $coupon_desc->fields['coupon_description'] . "\n\n" : '') . $text_coupon_help  . "\n\n" .
  strip_tags(sprintf(EMAIL_COUPON_REDEEM, ' ' . $coupon->fields['coupon_code'])) . EMAIL_SEPARATOR;

  $html_msg['COUPON_TEXT_VOUCHER_IS'] = EMAIL_COUPON_INCENTIVE_HEADER ;
  $html_msg['COUPON_DESCRIPTION']     = (!empty($coupon_desc->fields['coupon_description']) ? '<strong>' . $coupon_desc->fields['coupon_description'] . '</strong>' : '');
  $html_msg['COUPON_TEXT_TO_REDEEM']  = str_replace("\n", '', sprintf(EMAIL_COUPON_REDEEM, ''));
  $html_msg['COUPON_CODE']  = $coupon->fields['coupon_code'] . $text_coupon_help;
} //endif coupon

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

25 Aug 2008, 10:03 AM
#6
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

P.s. I just noticed that at the bottom of the original modules/create_account php there are 2 lines that are not included in the modules/custom/create_account php these are.

if (!isset($email_format)) $email_format = (ACCOUNT_EMAIL_PREFERENCE == '1' ? 'HTML' : 'TEXT');
if (!isset($newsletter))   $newsletter = (ACCOUNT_NEWSLETTER_STATUS == '1' ? false : true);

Would they affect what comes out in the welcome emails ? maybe someone who knows a bit about Captcha may be able to tell me why this is not in the custom file ? and does it need to be ?

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

26 Aug 2008, 4:00 AM
#7
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Sorry to keep adding to this but I keep forgetting to add extra info and while I am still trying to work out this problem i remember what I should have said !

The only email this code is showing in is the welcome email for new customers. I have gone into admin and sent a discount coupon from there and the code does not show in the email but does have the "welcome" code for the customer to use, all other emails sent from the site are fine.

everything else on our website works fine this is the last and only thing to fix does anyone know what file in the Captcha add on this may be coming from ? I have checked them all but with my very limited knowledge I can not seem to see anything wrong ANY help would be greatly appreciated

Kind Regards

Paul

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

26 Aug 2008, 6:34 AM
#8
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Hi All,

Well i went into admin and turned off Captcha on the sign up to see if that was actually causing the problem and it looks like it is Not Captcha as I am still getting the code in emails Ho Hum! back to checking the code for mistakes :frusty: sorry for all the useless posts before hand:blush: I will however post back here once I have fixed it just in case anyone else ends up with the same prob :smile:

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

26 Aug 2008, 8:50 AM
#9
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

OK!! I finally found the problem it was with a change made in the \includes\modules\YOUR_TEMPLATE\create_account php from the Captcha installation

Original create_account php from Captcha v. 2.9 11.08.2008

// initial welcome
    $email_text .=  EMAIL_WELCOME;
    $html_msg['EMAIL_WELCOME'] = str_replace('\n','',EMAIL_WELCOME);

    if (NEW_SIGNUP_DISCOUNT_COUPON != '' and NEW_SIGNUP_DISCOUNT_COUPON != '0') {
      $coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;
      $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");
      $coupon_desc = $db->Execute("select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . $_SESSION['languages_id'] . "'");
      $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");

      $text_coupon_help = sprintf(TEXT_COUPON_HELP_DATE, zen_date_short($coupon->fields['coupon_start_date']),zen_date_short($coupon->fields['coupon_expire_date']));

      // if on, add in Discount Coupon explanation
      //        $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .
      $email_text .= "\n" . EMAIL_COUPON_INCENTIVE_HEADER .
      (!empty($coupon_desc->fields['coupon_description']) ? $coupon_desc->fields['coupon_description'] . "\n\n" : '') . $text_coupon_help  . "\n\n" .
      strip_tags(sprintf(EMAIL_COUPON_REDEEM, ' ' . $coupon->fields['coupon_code'])) . EMAIL_SEPARATOR;

      $html_msg['COUPON_TEXT_VOUCHER_IS'] = EMAIL_COUPON_INCENTIVE_HEADER ;
      $html_msg['COUPON_DESCRIPTION']     = (!empty($coupon_desc->fields['coupon_description']) ? '<strong>' . $coupon_desc->fields['coupon_description'] . '</strong>' : '');
      $html_msg['COUPON_TEXT_TO_REDEEM']  = str_replace("\n", '', sprintf(EMAIL_COUPON_REDEEM, ''));
      $html_msg['COUPON_CODE']  = $coupon->fields['coupon_code'] . $text_coupon_help;
    } //endif coupon

Edited create_account php

// initial welcome
    $email_text .=  EMAIL_WELCOME;
    $html_msg['EMAIL_WELCOME'] = str_replace('\n','',EMAIL_WELCOME);

    if (NEW_SIGNUP_DISCOUNT_COUPON != '' and NEW_SIGNUP_DISCOUNT_COUPON != '0') {
      $coupon_id = NEW_SIGNUP_DISCOUNT_COUPON;
      $coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . $coupon_id . "'");
      $coupon_desc = $db->Execute("select coupon_description from " . TABLE_COUPONS_DESCRIPTION . " where coupon_id = '" . $coupon_id . "' and language_id = '" . $_SESSION['languages_id'] . "'");
      $db->Execute("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $coupon_id ."', '0', 'Admin', '" . $email_address . "', now() )");

// if on, add in Discount Coupon explanation
      //        $email_text .= EMAIL_COUPON_INCENTIVE_HEADER .
      $email_text .= "\n" . EMAIL_COUPON_INCENTIVE_HEADER .
      (!empty($coupon_desc->fields['coupon_description']) ? $coupon_desc->fields['coupon_description'] . "\n\n" : '') .
      strip_tags(sprintf(EMAIL_COUPON_REDEEM, ' ' . $coupon->fields['coupon_code'])) . EMAIL_SEPARATOR;

      $html_msg['COUPON_TEXT_VOUCHER_IS'] = EMAIL_COUPON_INCENTIVE_HEADER ;
      $html_msg['COUPON_DESCRIPTION']     = (!empty($coupon_desc->fields['coupon_description']) ? '<strong>' . $coupon_desc->fields['coupon_description'] . '</strong>' : '');
      $html_msg['COUPON_TEXT_TO_REDEEM']  = str_replace("\n", '', sprintf(EMAIL_COUPON_REDEEM, ''));
      $html_msg['COUPON_CODE']  = $coupon->fields['coupon_code'];
    } //endif coupon

These are the lines I removed as this is what was making it show up in email.

Starting from top down:

 . $text_coupon_help  . "\n\n" .


$text_coupon_help = sprintf(TEXT_COUPON_HELP_DATE, zen_date_short($coupon->fields['coupon_start_date']),zen_date_short($coupon->fields['coupon_expire_date']));


 . $text_coupon_help;

I hope everyone can understand what I did :smile: and that it may help someone else if they have the problem after installing Captcha which by the way is a fantastic add-on :smile:

Kind Regards

Paul

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.

26 Aug 2008, 9:55 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Further to the FAQ mentioned earlier, it would be more appropriate to add the missing define to your language file, rather than deleting functionality.
Granted, if you never use coupons, then feel free to hack out anything you want related to them. Just be aware that you're making upgrades more difficult later.

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

2 Sep 2008, 3:10 AM
#11
Join Date:
Jan 2008
Location:
Brisbane Australia
Posts:
20
Plugin Contributions:
0

Re: Code showing in welcome email after installing Captcha v. 2.9 11.08.2008

Thanks DrByte,

I appreciate your help and comments I will look into fixing the define as we will no doubt be adding our gift certificates back in soon, the date format doesn't matter for our discount coupons but it will for our GC's so thanks for the heads up :smile:

Kind Regards

Paul

P & T Aromatic Candles www.pandtaromaticcandles.com.au/candles
100% Natural Soy Wax Candles and Oil Burner Melts/Tarts. We also stock Genuine Designer Perfumes.