terminal42 / contao-notification_center

The most popular notification configuration extension for the Contao Open Source CMS!
63 stars 38 forks source link

Unsubscribe without notification throws error #321

Closed de-es closed 5 months ago

de-es commented 5 months ago

Testumgebung:

Steps to reproduce:

Fehlermeldung:

Terminal42\NotificationCenterBundle\Exception\Parcel\CouldNotCreateParcelException:
The message ID "0" does not exist.

Nun könnte man die Notification dort einfach zum Pflichtfeld machen.

Mein aktueller Usecase wäre aber genau der, dass ich keine Notification versenden möchte. Dann stellt sich natürlich berechtigterweise die Frage, warum ich denn überhaupt hier das NC-Modul verwende. Weil leider das Unsubscribe-Modul von Contao auch immer eine Mail verschicken will. Und es würde als Feature IMHO ja gut zum Subscribe-Modul passen, wo die Activation notification auch optional ist.

Also Workaround schicke ich die Mail aktuell einfach nach /dev/null.

fritzmg commented 5 months ago

Weil leider das Unsubscribe-Modul von Contao auch immer eine Mail verschicken will.

You could implement a removeRecipient hook that redirects immediately. This way Contao does not send the unsubscribe email.

Toflar commented 5 months ago

https://github.com/terminal42/contao-notification_center/commit/19acf509f614114bb1958f903300a479be965940

de-es commented 5 months ago

@Toflar Vielen Dank für die schnelle Reaktion. :heart:

@fritzmg Danke auch Dir für den Vorschlag. Das hätte ich dann alternativ umgesetzt.