# notifyUntil-Event (Shopware\_Modules\_Order\_SendMail\_Send) kann nicht unberbunden werden

**URL:** <https://forum.shopware.com/t/notifyuntil-event-shopware-modules-order-sendmail-send-kann-nicht-unberbunden-werden/37489>\
**Category:** Programmierung\
**Created:** [16. Juni 2016 um 06:50 UTC](https://forum.shopware.com/t/notifyuntil-event-shopware-modules-order-sendmail-send-kann-nicht-unberbunden-werden/37489 "2016-06-16T06:50:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hias](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@Hias](https://forum.shopware.com/u/Hias)\
**Post date:** [16. Juni 2016 um 06:50 UTC](https://forum.shopware.com/t/notifyuntil-event-shopware-modules-order-sendmail-send-kann-nicht-unberbunden-werden/37489/1 "2016-06-16T06:50:19Z")

</div>

Hallo,

ich versuche ein Plugin zu schreiben welches beim Email-Versand eingreift. Hierfür habe ich mich&nbsp;einen Listener&nbsp;an das Event ‚Shopware\_Modules\_Order\_SendMail\_Send‘ gehängt.

Mein Code wird auch ausgeführt, nur schaffe ich es nicht, den Versand der Originalmail zu unterbinden. In der Dokus steht "Return `null` if you want Shopware to proceed; return anything else to stop Shopware from proceeding.

Egal was ich zurück liefere in meiner Funktion, die Originale Mail wird versendet.

Kann mir jemand weiterhelfen was ich falsch mache?

---

<div class="post-metadata">

**Author:** ![DanielNogel](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@DanielNogel](https://forum.shopware.com/u/DanielNogel)\
**Post date:** [19. Juni 2016 um 13:47 UTC](https://forum.shopware.com/t/notifyuntil-event-shopware-modules-order-sendmail-send-kann-nicht-unberbunden-werden/37489/2 "2016-06-19T13:47:52Z")

</div>

Hi,

lt. Source sollte die Mail immer versendet werden, bis ein Eventlistener irgendwas zurück gibt. Sehe da so ad hoc keinen Fehler, kannst du deinen Code eben zeigen?

Daniel

---

<div class="post-metadata">

**Author:** ![Hias](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@Hias](https://forum.shopware.com/u/Hias)\
**Post date:** [20. Juni 2016 um 11:34 UTC](https://forum.shopware.com/t/notifyuntil-event-shopware-modules-order-sendmail-send-kann-nicht-unberbunden-werden/37489/3 "2016-06-20T11:34:19Z")

</div>

\<?php   
 class Shopware\_Plugins\_Frontend\_ModifyOrderMail\_Bootstrap extends Shopware\_Components\_Plugin\_Bootstrap { &nbsp;&nbsp;&nbsp; public function install() &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $this-\\>subscribeEvent( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;'Shopware\_Modules\_Order\_SendMail\_Send', &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'modifyOrderMail' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true; &nbsp;&nbsp;&nbsp; } &nbsp; &nbsp;&nbsp;&nbsp; public function modifyOrderMail(Enlight\_Event\_EventArgs $arguments) &nbsp;&nbsp;&nbsp; {&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$context = $arguments-\\>getContext(); &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if( $context != null){ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;print\_r("Context ist gefüllt"); &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;print\_r($context); &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$message = "Der Benutzer hat folgenden Artikel bestellt: " . $context['sOrderDetails'][0]['articlename']; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$header = 'From: webmaster@brixlent.de' . "\r\n" . &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;$mailSuccess = mail('md@brixlent.de', 'Testmail', $message, $header); &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;print\_r("MailSuccess: " . $mailSuccess); &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return $arguments; &nbsp;&nbsp;&nbsp; } } &nbsp;

---

<div class="post-metadata">

**Author:** ![davereu](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@davereu](https://forum.shopware.com/u/davereu)\
**Post date:** [10. Oktober 2016 um 20:04 UTC](https://forum.shopware.com/t/notifyuntil-event-shopware-modules-order-sendmail-send-kann-nicht-unberbunden-werden/37489/4 "2016-10-10T20:04:44Z")

</div>

In meinem Fall klappt das wunderbar - anstatt $arguments mal nen String, also bspw. return „no\_mail“, zurückzugeben hast du probiert oder?
