Results 1 to 10 of 14

Hybrid View

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

    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,086
    Plugin Contributions
    4

    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
    354
    Plugin Contributions
    1

    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
    1,928
    Plugin Contributions
    20

    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
    354
    Plugin Contributions
    1

    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
    1,928
    Plugin Contributions
    20

    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.

 

 

Similar Threads

  1. An error occurred while sending mail. We do not relay non-local mail. -- XAMPP
    By vadkins in forum Installing on a Windows Server
    Replies: 7
    Last Post: 2 Nov 2009, 07:28 AM
  2. Spam Using my E-mail and Templates
    By bobbiemckee in forum General Questions
    Replies: 1
    Last Post: 4 Jul 2009, 09:19 PM
  3. Replies: 6
    Last Post: 23 Oct 2007, 08:45 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
  •