Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Wondering if someone could help. I create a newsletter using FCKeditor as the wysiwig editor. If the title contains & and I use the node title as an email subject the & appears as a "_amp;" quotes appear in the subject as "_quot;". I am using Mimemail plaintext. This doesnt occur with all characters in the body. For example in the body & character appears as & quotes appear as "" however a bullet character appears as "_bull;" I had substitute the & and underscore to demonstrate the problem.
Comments
Comment #1
jerdavisCan you paste the raw message source here?
Jer Davis
Advantage Labs, Inc.
Comment #2
smalld CreditAttribution: smalld commentednode title = Test _amp; Test
should appear as Test & Test
but appears as Test _amp; Test
Body = Test _amp; Test _quot; Test _quote; _bull;
should appear as Test & Test "Test" •
but appears as Test & Test "Test" _bull; only the bullet entity in the body is not displayed correctly.
the & is substituted with an underscore so I can display this message.
Comment #3
smalld CreditAttribution: smalld commentedI solved the two problems with following. To solve the body not converting a broader range of entities I applied the following patch.
http://drupal.org/node/212130 212130-D6-decode-entities-support-all-entities.patch
To solve entities not converted in the email subject. I added the following line of code to Mimemail.module.
$subject = mime_header_encode($subject);
//Added the following line to convert HTML entities appearing in the subject line
$subject = drupal_html_to_text($subject);
$plaintext = $plaintext || variable_get('mimemail_textonly', 0);
Im not sure if this is the right way to go about this but it appears to work. Im doing some further testing.
Comment #4
Sutharsan CreditAttribution: Sutharsan commentedA similar issue was solved in Simplenews some time ago (#348392: Raw HTML characters in newsletter title and from address). It was caused by the use of check_plain(). Escaping the newsletter title and email address name is not needed. Perhaps this helps solving this issue.
@smalld: you can use
<code>
to display&
in the text. See the formatting instruction below the comment field.Comment #5
jerdavisAdded drupal_html_to_text() call on $subject