4

I have gone through and added HTML templates/emails for each of the template files in the CP Home -> Email Notification Templates but not all of them are being sent as HTML. I don't know what else I need to change. The Admin notifications are coming through as HTML and some of the others are as well.

For example, the 'Forgotten Password Instructions' comes through as HTML, but the 'Mailing List Activation Instructions' will not.

I have changed the variables in the Email class to be 'html' for mailtype.

There is nothing different between the emails except for the variables.

Any ideas?

v2.5.5 - Build Date: 20121220

1

Yes, while looking within the code I found that for some of these emails, the mailtype variable isn't being specified so for the HTML emails, you should put hack code:

$this->EE->email->mailtype = 'html';

with email code.

| improve this answer | |
  • Thanks for jumping in here. I noticed that too. I added the mailtype to each call. There are quite a few without. I also just "hard-coded" it in the mail class trying to force the mailtype. I still couldn't get it to work on all email notices. Above, I wasn't clear enough about this, I added the mailtype to all the occurrences and was still hit or miss. Have you tested for all notices? It seemed like the admin notices were HTML as well as some of the user notices, while the rest would not. – W3bGuy Mar 14 '13 at 20:05
  • Can you let me know where you added the mailtype varibale and it's still not working for you. So that I can also look within. I haven't tested all but once added the mailtype variable for notification of "Forgot Password" and it worked for me. – Bhashkar Yadav Mar 14 '13 at 20:09
  • I had to move away from this for the time being and accept text emails for notifications right now. :( – W3bGuy Apr 1 '13 at 16:48
1

I figured out this awkward behaviour. You must set the mailtype BEFORE you set the message data. If you set it after the message it will have intrepreted the message as plaintext already.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.