简体   繁体   中英

How to enable / force HTML in a private message sent via Rules?

I'm using the module Privatemsg on a website I'm currently working on.

I have a user which has a special Role ("system user") and which is only used to send automatic notifications, through private messages, to other users on the website.

This user is allowed to use my "HTML" text-format. When logged in with this special user account, I'm able to choose between "plain text" and "html" text formats while manually sending a private message. Plain text is set by default, though.

Every notification sent by this user is automatically generated and sent through Rules, using the "send message" action.

Unfortunately, I can't get the messages sent this way to take HTML into account (I need to put various internal links in those messages).

Is there a way to enable (or force) HTML in private messages sent by Rules?

Well, it's not exactly what I'd like to achieve, but until I find another (better) solution, there's a trick to allow this:

Go to the page Administration > Settings > Content authoring > Text formats, and drag/drop the "HTML" (or "Full HTML" or whatever text format you need) at the top of the list. This way, this text format will be used by default by the textarea in the "Send message" Rules action.

Note that as far as I'm concerned, this looks more than a "trick" than a real solution to this issue.

And also, note that I only allowed my "system user" to use the HTML format I placed on the top of the list, for obvious security reasons.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM