Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Registration Email


Guest

Recommended Posts

Hello Everyone,
 
I've been working on getting on our new customer registration email working and didn't have any problems until I wanted to put HTML in the TEXT_ORIGIN_LOGIN, as well as EMAIL_GREET_NONE.  When I do, the fields completely disappear from the emails; with TEXT_ORIGIN_LOGIN not returning any errors at all.
 
apache2 error log returns this for the EMAIL_GREET_NONE

PHP Warning:  sprintf(): Too few arguments in /srv/www/.../test/create_account.php on line 305, referer: http://pge.powergatellc.com/test/create_account.php
 
 
 
the code for TEXT_ORIGIN_LOGIN
define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><b>NOTE:</b></font></small> If you already have an account with us, please login at t
he <a href="%s"><u>login page</u></a>.');

 

EMAIL_GREET_NONE

define('EMAIL_GREET_NONE', '<table style="width:100%; background-color:#FF0000; height:93px;"><tr><td><img src="http://.../PRIMARY-LOGO-INVERTED.png"></td></tr></table> Dear %s' . "\n\n" . 'Dear %s' . "\n\n");

and finally the root create_account.php code snippet for line 305 (305 highlighted)

// build the message content
      $name = $firstname . ' ' . $lastname;
 
      if (ACCOUNT_GENDER == 'true') {
         if ($gender == 'm') {
           $email_text = sprintf(EMAIL_GREET_MR, $lastname);
         } else {
           $email_text = sprintf(EMAIL_GREET_MS, $lastname);
         }
      } else {
        $email_text = sprintf(EMAIL_GREET_NONE, $firstname); //LINE 305
      }
 
      $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
      tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 
      tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
    }
  }
Link to comment
Share on other sites

Hi,

 

define('EMAIL_GREET_NONE', ...) has two "Dear %s".

 

Remove one and the error should be gone.

 

AD

Thank you very much for spotting this, I guess that after looking at this for too long my eyes blurred over that.  Unfortunately though, this did not solve the error and TEXT_ORIGIN_LOGIN and EMAIL_GREET_NONE are still not showing in the email that would be sent to the customers.  The GREET message will work with just the " 'Dear %s' . "\n\n" ", but after I try and insert the HTML it whole thing disappears, as with the ORIGIN.

 

Thank you, again, for spotting that.

Link to comment
Share on other sites

I current have the emails setup to use MIME HTML.  Here is the current settings for emails:

 

E-Mail Transport Method - sendmail

E-Mail Linefeeds - LF

Use MIME HTML When Sending Emails - true

Verify E-Mail Addresses Through DNS - false

end E-Mails - true
 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...