Prevent sending emails with hook_mail_alter() in d6?
Hi all, i am looking for a clean way to prevent drupal 6 sending emails on my custom conditions. In drupal7 i can use hook_mail_alter() and set "send" parameter to false. Is there an workaround for that drupal6? thank you, Mario
On Thu, Mar 15, 2012 at 7:20 AM, Mario Schnauss wrote:
Hi all,
i am looking for a clean way to prevent drupal 6 sending emails on my custom conditions. In drupal7 i can use hook_mail_alter() and set "send" parameter to false. Is there an workaround for that drupal6?
Did you try to do it the same way? I just looked at api.drupal.org to compare the differences and I don't see any. -- Earnie -- https://sites.google.com/site/earnieboyd
Hi Earnie, I set $messages['send'] to false, but it had no effect. drupal_mail() does differ in d6 and d7 in that case, so i think that won't work. Is there any other chance to stop mails that are already initialized with drupal_mail()? Mario -----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Earnie Boyd Sent: Donnerstag, 15. März 2012 13:34 To: development@drupal.org Subject: Re: [development] Prevent sending emails with hook_mail_alter() in d6? On Thu, Mar 15, 2012 at 7:20 AM, Mario Schnauss wrote:
Hi all,
i am looking for a clean way to prevent drupal 6 sending emails on my custom conditions. In drupal7 i can use hook_mail_alter() and set "send" parameter to false. Is there an workaround for that drupal6?
Did you try to do it the same way? I just looked at api.drupal.org to compare the differences and I don't see any. -- Earnie -- https://sites.google.com/site/earnieboyd
On Thu, Mar 15, 2012 at 9:25 AM, Mario Schnauss <mario.schnauss@unic.com> wrote:
Hi Earnie,
I set $messages['send'] to false, but it had no effect. drupal_mail() does differ in d6 and d7 in that case, so i think that won't work. Is there any other chance to stop mails that are already initialized with drupal_mail()?
Ah, yea, I see the difference now. There was obviously a ticket to resolve the issue that was not back ported to D6, you could try looking for that. The only other options, make sure the $send parameter to drupal_mail is set to FALSE or modify the core code for drupal_mail to add the bits after ``if ($send) {'' that are present in D7. -- Earnie -- https://sites.google.com/site/earnieboyd
Thank's a lot Earnie, the ticket you mentioned is http://drupal.org/node/800434. Now i know this feature will come some day. Mario -----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Earnie Boyd Sent: Donnerstag, 15. März 2012 15:02 To: development@drupal.org Subject: Re: [development] Prevent sending emails with hook_mail_alter() in d6? On Thu, Mar 15, 2012 at 9:25 AM, Mario Schnauss <mario.schnauss@unic.com> wrote:
Hi Earnie,
I set $messages['send'] to false, but it had no effect. drupal_mail() does differ in d6 and d7 in that case, so i think that won't work. Is there any other chance to stop mails that are already initialized with drupal_mail()?
Ah, yea, I see the difference now. There was obviously a ticket to resolve the issue that was not back ported to D6, you could try looking for that. The only other options, make sure the $send parameter to drupal_mail is set to FALSE or modify the core code for drupal_mail to add the bits after ``if ($send) {'' that are present in D7. -- Earnie -- https://sites.google.com/site/earnieboyd
The Devel module may be able to help. salvis
participants (3)
-
Earnie Boyd -
Hans Salvisberg -
Mario Schnauss