Hello,

I want to test the notifications module on my web site (I have 100 suscribers). But your module don't reroute the emails send with this module. Is it possible to make that ?

thanks

Comments

kbahey’s picture

Title: It does NOT work with notifications module ! » When using notifications module, reoute_email cannot override the email parameters
Project: Reroute Email » Messaging
Version: 6.x-1.0 » 6.x-1.x-dev

Notifications uses the messaging module. The messaging module uses the standard drupal email sending mechanism.

In messaging.module there is this function.

function messaging_mail_send_msg($destination, $message, $params = array()) {
  // Get from, headers, mailkey, etc...
  $message['to'] = $destination;
  $message['id'] = 'message-'.$message['type'];
  $message['headers'] = messaging_mail_headers($message, $params);
  return drupal_mail_send($message);
}

I don't think they need to use drupal_mail_send() but rather drupal_mail() here.

This way, other modules can override the To: address and reroute email would work again.

I am changing the project for this

jose reyero’s picture

Status: Active » Closed (won't fix)

True, it's messaging module's fault, not using drupal_mail_send().

The reason we cannot do that is because to support some features of this framework we need some more control over the mails, like being able to set specific message id and headers. It also wouldn't help that much, as drupal mail is only one of the sending methods supported.

In order to prevent the messages to be sent (all of them, not only mails but also SMSs or IMs) you can use the Debug module provided with this package, and enable debug mode in the module settings.