3

I currently have a plugin that's successfully sending email using EmailModel(). The problem is: it's sending a multi-part email with HTML and plain text components. For this particular email, it would be best if I could just send the plain text portion.

Is there a way to disable the HTML segment when sending via EmailModel()?

2

Currently not. If Craft sees that there isn't anything specified for the htmlBody property of EmailModel will run the body property though Markdown and set that to htmlBody.

  • Ok, good to know. I've managed to get a minimal version of the HTML working as expected, so it probably won't be too bad. Thanks for the confirmation, though! – Gavin Anderegg Dec 17 '15 at 19:08
  • I see this is still the case. It's actually a real pain not being able to send plain text emails. I'm having to roll back to php mail() to get the job done for my purpose. – JamesNZ Mar 13 '17 at 1:48
  • @JamesNZ You should consider thumbs-upping/leave a comment here: github.com/craftcms/cms/issues/1107 – Brad Bell Mar 13 '17 at 3:51

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.