In mimemail.rules.inc in mimemail_rules_action_info() please set "sanitize" to FALSE for body param

        'body' => array(
          'type' => 'text',
          'label' => t('Body'),
          'description' => t('The mail\'s HTML body. Will be formatted using the text format selected on the <a href="@url">settings</a> page.', array('@url' => url('admin/config/system/mimemail'))),
          'sanitize' => FALSE, //<--- HERE SHOULD BE FALSE
          'optional' => TRUE,
          'translatable' => TRUE,
        ),

It gives much problems for custom tokens which contain HTML markup.

Comments

Mykola Dolynskyi created an issue. See original summary.

TR’s picture

Status: Active » Reviewed & tested by the community

That would break #1814922: Rule sanitizes the $body if populated by a parameter, which requires sanitize to be TRUE.

Can you give specific details about how to reproduce your problem?

TR’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Set wrong status ...

Mykola Dolynskyi’s picture

I don`t understand what it would break.
All works fine if body sanitize = false.

Just now after update I killed 3 days again debugging this problem, because I forgot about this 'sanitize'=>true set in mimemail code. Hundreds of emails with broken markup with workflow notifications were sent because of this to people including bosses :(

Part of my comment from topic you showed

Custom module solution:

function my_help_func_rules_action_info_alter(&$info) {
    if(!empty($info['mimemail'])) {
        $info['mimemail']['parameter']['body']['sanitize'] = false;
    }
}

TR’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

As I said, this reverses the changes made in #1814922: Rule sanitizes the $body if populated by a parameter so if you expect this to be fixed you really need to make an argument that the previous change was wrong, or you need to present a solution that works for that previous issue as well as this current issue.

Without steps to demonstrate this problem, we cannot do anything.