Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default E-Mail Templates

    I'm trying to write a module that uses email templates in the /email/ directory. While the HTML version the email sends OK, the plain text version seems to send along the CSS coding. Other than making a CSS file and remote referencing to my site, which will likely be blocked by most email programs anyway, does anyone have and idea of how to stop having the CSS code appear?

  2. #2
    Join Date
    Jan 2007
    Posts
    1,484
    Plugin Contributions
    10

    Default Re: E-Mail Templates

    I don't think you are supposed to include any CSS in a text email, that's why it's a text email. So you will need two email templates.

    Zen Cart and it's community are the best!!

  3. #3
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: E-Mail Templates

    But CSS is included in the default (installed) HTML files in the same directory. So it's included as well but works fine with those templates unless I'm doing something wrong.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: E-Mail Templates

    The templates in your /email directory are used for sending HTML emails only. Text-based email is built by whatever PHP file you're using to create the communication.

  5. #5
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: E-Mail Templates

    Quote Originally Posted by lat9 View Post
    The templates in your /email directory are used for sending HTML emails only. Text-based email is built by whatever PHP file you're using to create the communication.
    Aha... I was going to assume that next. So I guess at the send time, I would have to check for the customers email option choice?

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: E-Mail Templates

    Take a look at /includes/modules/create_account.php, which contains code to send the customer a welcome e-mail when they create an account. This uses the template file /email/email_template_welcome.html if the customer has indicated that s/he wants HTML-formatted e-mail.

    Towards the end of the PHP file is where the message is built, starting with the comment "// build the message content". You'll see that a text message string is built as well as the content required for the HTML template, followed by a call to zen_mail (in /includes/functions/functions_email.php) which determines whether to send TEXT or HTML based on the customer's preference in your database.

  7. #7
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: E-Mail Templates

    Quote Originally Posted by lat9 View Post
    Take a look at /includes/modules/create_account.php, which contains code to send the customer a welcome e-mail when they create an account. This uses the template file /email/email_template_welcome.html if the customer has indicated that s/he wants HTML-formatted e-mail.

    Towards the end of the PHP file is where the message is built, starting with the comment "// build the message content". You'll see that a text message string is built as well as the content required for the HTML template, followed by a call to zen_mail (in /includes/functions/functions_email.php) which determines whether to send TEXT or HTML based on the customer's preference in your database.
    This works perfectly for what I was needing to do. Thanks.;

  8. #8
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: E-Mail Templates

    This was very helpful to me...been working with zen_mail and was confused as to why when I sent test mail to two different addresses, the mail was not the same.

    The test account email was set to HTML and the admin email was text only. I was missing the code that put the $email_text content into the EMAIL_MESSAGE_HTML array element!

    Thanks
    Experience is what you get when you don’t get what you want…

  9. #9
    Join Date
    Sep 2008
    Posts
    397
    Plugin Contributions
    0

    Default Re: E-Mail Templates

    Quote Originally Posted by retched View Post
    This works perfectly for what I was needing to do. Thanks.;
    Hi retched,

    When your email-template be come available? I can't wait...

    Can you help with my current issue on Create account welcome email? Image and link not show up. I don't what's wrong with the codes.

    http://www.zen-cart.com/forum/showpo...16&postcount=5

    Thanks in advance!

  10. #10
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: E-Mail Templates

    Quote Originally Posted by hara View Post
    Hi retched,

    When your email-template be come available? I can't wait...

    Can you help with my current issue on Create account welcome email? Image and link not show up. I don't what's wrong with the codes.

    http://www.zen-cart.com/forum/showpo...16&postcount=5

    Thanks in advance!
    Oh this was in regards to the SnapAffiliates module emails... they were sent out kind of... half-assedly, so now I have to rewrite that portion of code. I'll be glad to help with your problem though on that topic page.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Why my new templates installed doesn't appear in the templates selection?
    By dijah in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 14 Apr 2014, 11:08 AM
  2. Previewing Available E-mail Templates
    By lindenboy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Apr 2011, 09:29 PM
  3. Spam Using my E-mail and Templates
    By bobbiemckee in forum General Questions
    Replies: 1
    Last Post: 4 Jul 2009, 09:19 PM
  4. e-mail templates, footer plaintext doesn't match HTML?
    By funkey in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 13 Feb 2007, 02:51 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR