Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Rich Text / HTML Email Support

Hello Everyone,

So, I asked this question in the relevant plugin area and have not received a response (The thread was last active in 2011 and was unanswered).

I have the WYSIWYG (CLEditor) plugin to enable rich text and then I am also running the EmailSubscribe plugin. The problem is that the email notifications don't seem to support rich text as the formatting coding appears throughout the body of the text.

I am completely new to PHP and have only a little bit of programming experience (Basic and Java). I figure I need to provide rich text support for the emails, but I'm not sure where or how to do that. Is that a modification I need to make to Garden or the plugin? How difficult of a process is this? I may just disable the WYSIWYG plugin if it's beyond my ability to make the necessary tweaks.

Thanks for the help!
-Daniel

Best Answer

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited February 2013 Answer ✓

    @dcrickmore , in forum/library/vendors/phpmailer.php it advices to use this Sets message type to HTML it contains lots of good ideas.

    public function IsHTML($ishtml = true) {
        if ($ishtml) {
          $this->ContentType = 'text/html';
        } else {
          $this->ContentType = 'text/plain';
        }
      }
    

    you could also add this to the config.php

    $Configuration['Garden']['Email']['MimeType']= 'text/html';

    fr3em1nddcrickmoreperegrine

Answers

  • you could use PHP htmlspecialchars($THE_EMAIL_BODY_VARIABLE_HERE) before sending the EmailSubscribe triggers the sending of the email.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited February 2013 Answer ✓

    @dcrickmore , in forum/library/vendors/phpmailer.php it advices to use this Sets message type to HTML it contains lots of good ideas.

    public function IsHTML($ishtml = true) {
        if ($ishtml) {
          $this->ContentType = 'text/html';
        } else {
          $this->ContentType = 'text/plain';
        }
      }
    

    you could also add this to the config.php

    $Configuration['Garden']['Email']['MimeType']= 'text/html';

    fr3em1nddcrickmoreperegrine
  • @vrijvlinder - You are my hero. I looked around the other stuff for a while and then did the last step and it worked beautifully. All the time I've spent and it was one line of code - ha! Thank you so much!

    vrijvlinder
Sign In or Register to comment.