I recently upgraded to the dev version to make use of the input filter, and noticed the tokens worked in the subject line, but no longer worked in the text message.

For instance, [node:nid] prints the node id # in the subject line, but in the message text it prints as [node:nid].

Comments

sgabe’s picture

Please, try the patch in #1090286: Prepare action messages with drupal_mail() to allow alteration. I think it solves this issue.

sgabe’s picture

Title: token - works in subject line but not message » Tokens don't work in the body of Rules action messages
Status: Active » Fixed

This was caused by #1108324: Add input filter to HTML message for system and Rules actions. I added a submit function to unwrap the HTML message body from the input filter wrapper.

/**
 * Handle submission for action "Send an HTML mail to a user" configuration form.
 */
function mimemail_rules_action_mail_submit(&$settings, $form, $form_state) {
  // Unwrap the HTML message from the input filter wrapper.
  $settings['message_html'] = $settings['message_html_filter']['message_html'];
  unset($settings['message_html_filter']);
}

The fix is committed and it will be in the development snapshot soon.

itserich’s picture

Thank you, it seems to be working.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.