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.
Hello,
if I want some tokens to appear bold or underlined in the email, it is not possible, the message is displayed with stars but no formatting.
For example if I write :
<p>Hello [message:user:name], There is a new post called <strong><a href="[message:field-node-reference:url]">[message:field-node-reference:title]</a></strong>
The message will show:
Hello test user 1 There is a new post called *Fusce quis purus [1]*,
it might be a problem with my text editor.
Comments
Comment #1
amitaibuDid you try to change the text-formatting to Full-HTML?
Comment #3
wbobeirne CreditAttribution: wbobeirne commentedI'm having this issue as well. Using tokens gets me something like:
And using a url I entered myself gets me something like:
My text field is on full HTML. I believe this has to do with the headers drupal_mail() uses by default. None are passed in in MessageNotifierEmail's deliver function, and drupal_mail() uses text/plain by default.
Comment #4
wbobeirne CreditAttribution: wbobeirne commentedScratch that, the tokens thing was a separate issue. However, the issue still remains that we can't pass in headers.
Comment #5
kevinquillen CreditAttribution: kevinquillen commentedYes, token replacement works fine until you link a token, then my token value is escaped before it can be rendered, and the link is broken. I am using the latest CK Editor 3.x build with WYSIWYG module.
Comment #6
tassaf CreditAttribution: tassaf commentedAny solution for that?
How to send HTML mail using MESSAGE and MESSAGE NOTIFY module
Comment #7
geek-merlinAd #5:
> Yes, token replacement works fine until you link a token
This comes from #1774218: Consider doing token replacement before text formatting?.
You may define a text format that does not change tokens in links.
Comment #8
tassaf CreditAttribution: tassaf commentedI don't understand what to do in order to remove the [] things related to links
Comment #9
cmonnow CreditAttribution: cmonnow commentedJust for those still struggling with href stuffing up and appending a ] (ending square bracket) to the end:
If you're using the Panopoly distribution, for example, the default HTML format will cause the above error (anything after a colon (:) will be converted into plain text). You can create an unfiltered text format in /admin/config/content/formats by selecting no additional checkboxes but then a known WYSIWYG module bug will give you an annoying invalid domain error. You can workaround this bug by adding a WYSIWYG filter but deleting localhost from the domain options - save the format - reopen the new format and remove the WYSIWYG filter and save again.
Comment #10
jaylotta CreditAttribution: jaylotta commentedUnchecking the "Convert URLs into links" for the text format you are using will achieve the result. This option causes HTML special characters to be converted before token replacement occurs. Since [,], and : are escaped to their respective %## representations, token replacement doesn't work.
Go to Configuration > Text Formats and disable that filter.
Comment #11
bluegeek9 CreditAttribution: bluegeek9 as a volunteer commented