Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2007
    Location
    Johannesburg
    Posts
    27
    Plugin Contributions
    1

    email error Password in email is "%s" and not password?

    After creating an account, in both HTML and Text emails, the following text is shown:

    "The password you have been assigned is: %s and your login ID is the e-mail account in which you received this message."

    This is the define in english/create_account.php

    define('EMAIL_TEXT', 'With your registration, you can now take part in the various online shopping services we have to offer. Some of these services include:' . "\n\n<p>" . '<ul><li><strong>Permanent Cart</strong> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n\n<br>" . '</li><li><strong>Address Book</strong> - We can now deliver your products to an address other than your own! This is perfect to send birthday gifts.' . "\n\n" . '</li><li><strong>Order History</strong> - View the history of purchases you have made with us.' . "\n\n" . '</li><li><strong>Convenience</strong> - View Grandiflora\'s popular products and competitive prices from the convenience of your home or office.' . "\n\n</ul>" . '<p>The password you have been assigned is: %s and your login ID is the e-mail account in which you received this message.');

    I've tried various combinations of single quotes but it didn't make a difference.

    I copied the text from the "forgot_password.php" page which worked perfectly, but in this email it also doesn't work. Other "included" setting like the store name, email adress links and site links work fine.

    Please could someone help me - I am meant to launch on 29 February and I can't if no-one can register!


  2. #2
    Join Date
    Apr 2006
    Location
    Sydney, Australia
    Posts
    112
    Plugin Contributions
    0

    Default Re: Password in email is "%s" and not password?

    How is the account being created? By ADMIN or by CUSTOMER.

    Correct me if im wrong but if the customer registers they set there own password they don't get assigned one?

    I know the ADD CUSTOMER from ADMIN mod gives a similar message to this.
    alfo

    www.alfo.com.au
    online ordering for catering, tea parties, take away food and retail from alfo cafe
    www.alifefullof.com.au
    tea party essentials: leaf tea, coffee beans, oils, chocolate and more

  3. #3
    Join Date
    Jul 2007
    Location
    Johannesburg
    Posts
    27
    Plugin Contributions
    1

    Default Re: Password in email is "%s" and not password?

    To my knowledge the password is being created correctly in both the admin and customer interfaces. It is somehow just not being parsed to the email at all. It doesn't work in either text or HTML emails. Other variables are being parsed correctly. The password is being parsed correctly to the "forgot password" email.

    I'm going to try to go back to the original email text and see if that works.

    DOES ANYONE KNOW...

    Why sometimes single quotes are used and sometimes double quotes?

    Since the password is pulled from the database, why doesn't it need the . %s . on either side (the dots)? Or does it?

    There are other %s in the email (from other lines of text). How does it know which information goes in which line. Is it in order - perhaps by deleting other lines of text I have shortened the number of calls and messed up the order? Maybe my problem is not in this define, but in an earlier one?

    \n doesn't work in emails. Since its between double inverted commas already can I do <p> instead without messing things up?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Password in email is "%s" and not password?

    1. The normal Zen Cart content for that define has NO reference to password information. So, if yours does, then either *you* added it, or some addon you installed has added it.

    2. Since the normal Zen Cart behavior has no instructions to send the password during create-account, if you want to have it know what to replace the %s with, you'll have to either fix your addon or fix your custom code to do it correctly.

    3. %s is a "string" replacement placeholder. More information on placeholders can be studied here:
    http://www.php.net/manual/en/function.sprintf.php

    4. The use of \n as a line-break works fine if there are double-quotes around it.
    That's why you see "\n\n" in various email-related sections.

    5. The <p> and <br> tags are HTML tags ... and ... as with any HTML tag, should not be expected to produce desired results in non-HTML-formatted emails.

    6. Double-quotes are used around special characters so that they are treated as required. Otherwise single-quotes are used in order to process strings more quickly.
    .

    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.

  5. #5
    Join Date
    Jul 2007
    Location
    Johannesburg
    Posts
    27
    Plugin Contributions
    1

    Default Re: Password in email is "%s" and not password?

    Thank you so much for such an informative reply!!

    I will change the wording on the email to remind them that if they forget their password they must click on the link on the page. It's something I'd like to include later though.

    The reason why my emails are formatting badly may be because I changed double quotes to single quotes - I'll go back and correct them then I can take out the HTML.

    Thank you!

 

 

Similar Threads

  1. v153 Customers not receiving "Password Forgotten" email
    By t4gal in forum General Questions
    Replies: 24
    Last Post: 25 Nov 2014, 09:00 PM
  2. Replies: 4
    Last Post: 4 Jul 2009, 12:05 AM
  3. Email Variables like $EMAIL_CLOSURE in "password forgotten"
    By miriam_t in forum General Questions
    Replies: 0
    Last Post: 8 May 2009, 01:22 PM
  4. New "forgotten" password not working? Help!
    By nukabe in forum General Questions
    Replies: 4
    Last Post: 19 May 2008, 11:18 PM
  5. Blank "new password" email
    By craftzombie in forum General Questions
    Replies: 1
    Last Post: 15 Dec 2006, 04:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg