Note: Not related to #321079: Multi-part message in MIME format wrong plain text format.
When I send a simplnews newsletter it is arriving in the inboxes of everyone as a plain text email but all the elements are wrapped in html tags. For example:
<h2>title of the newsletter</h2>
<p>information blah blah blah</p>
<p>yet more information you can't live without<br />
unless of course you live under a rock.</p>
<p>see ya,<br />
me</p>I do not have mime mail installed.
Background: I had this formerly set up as a Drupal 5.x site with simplenews and mimemail. When I upgraded my site to Drupal 6.x I disabled both and only installed simplenews for the updated site. For more than a month I have been sending simplenews newsletters out, But suddenly I am getting this problem after the update from Drupal 6.4 to 6.5.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | simplenews.321750.patch | 5.8 KB | sutharsan |
Comments
Comment #1
tcblack commentedFixing version number.
It appears the dev version expects mimemail to be installed?
After installing Mime Mail 6.x-1.x-dev (2008-Sep-21) the problem was solved. Still you should be able to use simplenews without mime mail.
Comment #2
ddanier commentedSeems like this is a real bug, which has nothing to do with wether mimemail is used or not. What mimemail does here is really sending HTML-mails, the but itself remains.
After digging around in the code for some time I found, that the email is converted to plain text in simplenews.module on line 1514. The code here ready like this:
It seems like the array under $context['node']->simplenews has changed, so $context['node']->simplenews['s_format'] does not exist anymore. Changing it into $context['node']->simplenews['advanced']['s_format'] fixes the problem and mails get sent using plain text.
I'm changing the status of this ticket to patch (code needs review), however I do not append a patch. The change is far to simple for this. ;-)
Comment #3
sutharsan commentedYes, it is this simple. However the same trick needs to be applied to a lot more places in the module. The attached patch fixes this.
Patch committed.
Comment #4
ddanier commentedYou're right. I just tested this with sending test-emails. When the newsletter is send for real (I use cron for this) changing line 1514 does not do the trick. Thanks for the patch. :)
Comment #5
jmail.af commentedHi,
Sorry I am new to drupal, and I would also like to use the patch above - but how exactly do you use the patch? Do I download that file and then just insert it into the simplenews module?
Thanks in advance for any help.
Comment #6
sutharsan commentedpatch committed means applied to the development version. Just download 6.x-1.x-dev.