ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Custom HTML emails

May 14, 2010 1:35am

Subscribe [4]
  • #1 / May 14, 2010 1:35am

    TrevorScott

    19 posts

    Hi All,

    I’ve been handed a small stack of HTML-centric email templates. The client wants to substitute these emails over the stock emails.

    I’ve switched the sending email format to HTML in Admin > System Preferences > Email Configuration. I have also edited the “forget_password” template through Admin › Specialty Templates › Email Notification Templates.

    When I send myself a “forgot password” email, the email comes in as plain-text message. What HTML code I have placed in the email template <horizontal line>, is translated into htmlenteties. I user WindowsLive mail (painful) so I know that HTML emails are supported.

    I have set up my own external Mail class which does send HTML emails.

    My options are to figure out how to use the native EE functionality and produce the HTML based emails, or try to intercept EE’s EEmail class call. I have looked into the intercept options and I have to say that I am totally lost when it comes to hunting down each email send of interest.

    My task includes: member registration validation, lost passwords, forum posts, etc… They are all over the place.

    Suggestions? I am not above hacking into the core classes (I know it is a bad practice). Perhaps I need to hack the EEmail class and not the rest of the system. :(

    Totally lost :(

  • #2 / May 14, 2010 10:22am

    Sue Crocker

    26054 posts

    Using HTML in these kinds of template isn’t supported but Pascal mentioned you could flip $mailtype to html in core.email.php.

    NOTE: You’d do this at your own risk, though. We can support these kinds of changes.

    Does that help?

  • #3 / May 14, 2010 1:33pm

    TrevorScott

    19 posts

    The HTML templates have now been “enhanced” to include embedded images and dynamic content. For this reason, I’ve decided roll my own. :( I am using a stand-a-lone file/class that uses PEAR’s mime email class. On a technical level, I am using file_get_contents to get both html and text versions. 😊 The biggest task is to figure out where/when to send the emails.

  • #4 / May 14, 2010 4:42pm

    Ingmar

    29245 posts

    Very good. Since we moved beyond Tech Support at this point I’ll shift this to Howto. Please post again in case there’s anything else.

  • #5 / May 14, 2010 8:39pm

    Wouter Vervloet

    758 posts

    You’d almost wish that PostageApp was out of beta… It is a paid service, but the things you can do with it are awesome.

    Greetz,
    Wouter

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases