By Daniel E on
Hi,
I'm desperatly trying to do this for hours.
I have installed Rules, HTMLMail, Mime Mail, Mail System, ...
I have a content type with a textfield (filter: full-html).
In rules I use the value of that field for the email body.
The mail is being sent, but all html is removed!
When I manually insert html in the rules field, the html is not stripped.
I don't even know which module is responsible for this. How can I use HTML from a cck field as input for HTML mail?
Thank you
Comments
OMG. I just got it working by
OMG. I just got it working by manually putting <? return $text['value']; ?> into the value field (facepalm).
It's a mystery to me why I couldn't use the data selector.
Hi Is this 7 or 6? If it is
Hi
Is this 7 or 6? If it is 7, could you post a sample of your code here, so that I get some idea how to go forward? I have the same problem.
Thanks
Jaya
Jaya
Formatted email using rules
I have a value from a node to display in the email when ever a user creates a node.
[node:field-announcement]
I write [node:field-announcement:value] this in the message of rules module to include this in the email. But the format converts in to plain text format which I do not want. I want the same format as the user created it. What exactly you did and in my case what do I do get the text with the format?
Thanks in advance
HTML Mail/MIME Mail
Do you have HTML Mail and MIME Mail modules installed? You need to these to send something other than plain text emails.
I have both of them installed
I have both of them installed along with the Html Mail. I cant get any images in to my mail even though i have them. And all the fonts are stripped off the email.
HTML Mail/MIME Mail Configuration
Did you check the configuration of HTMLMail at admin/config/system/htmlmail ? Is the MIME Mail properly configured with required Pear classes?
BTW, you might want to open a new issue. This issue is getting a little confusing with the other unrelated entries.
HTML Mail/MIME Mail Configuration
What do you mean by the required pear classes? I was thinking it uses the default settings for mailing which was mimemail system
Any ways i have created an another issue.
http://drupal.org/node/1816930
I ran into this same issue
With Drupal 7.14,
If I try to send formatted Text as a parameter to input the body for sending an HTML email in a Rules Component, the data selector value doesn't use the formatting. Everything gets stripped back to plain text. If I use the PHP code as stated above, it almost complete works. I say almost completely, because some of the tokens don't get replaced properly even then. The [site:xxx] ones get replaced correctly, but the input fields from the VBO that is calling this component do not.
For example, I have an input user set up as a parameter called in-user that is filled in by the VBO. I have a parameter of type text, that allows me to type in text to be sent in the subject field of the HTML mail. In the subject field, the replacement pattern [in-user:field-firstname] gets replaced correctly. I have another parameter of type formatted-text, that I used to enter formatted text to be sent in the Body field of the HTML mail. As I have stated before using the data selector (or even the direct input using the suggested replacement patterns, as I recall), the body is sent, but in plain text. If I use the PHP code, the body is sent with the HTML (including images!), but the replacement pattern [in-user:field-firstname] does not get replaced. However, [site:current-date] does get replaced correctly.
I am fairly new to Drupal and this community, so I am not sure if this is the correct place to put this note, but I wanted to say thanks for the answer that worked, and hopefully encourage someone (not sure which module?) to look into this, and try to get email working better in Drupal 7. Thanks again for the tip! I am a bit further than I was last night!
I have the same issue but
I have the same issue but with Rules and Privatemsg.
I have a Rules component to send a message via the privatemsg module. By adding debug lines I've found that regardless of the 'text format' of the field, the Rules module removes all tags from the parameter before invoking the action function ('privatemsg_rules_new' in my case).
[body:value] gives content with no tags.
Switching to PHP mode
return $body['value'];Gives the full HTML content as desired, but doesn't replace tokens in {this} format or [this] format (as suggested above).