codefog / contao-events_subscriptions

Contao extension that allows members of your website to subscribe to the events
MIT License
10 stars 5 forks source link

Image in Event leads to emails not being sent #79

Closed Defcon0 closed 2 years ago

Defcon0 commented 2 years ago

Hello,

if I have assigned a singleSRC in my event, the mail isn't sent anymore. Cause is this:

https://github.com/codefog/contao-events_subscriptions/blob/master/src/Codefog/EventsSubscriptions/NotificationSender.php#L146

This leads to binary uuid being added to the tokens field.

2 solutions would be possible:

  1. fix it here and skip these values
  2. fix it in notification center -> scan all values and skip binary ones.

Currently I check problematic values with following code:

        // remove non-printable characters
        $cleanedTokens = [];

        foreach ($tokens as $k => $v) {
            if (\json_encode($v) !== false) {
                $cleanedTokens[$k] = $v;
            }
        }

        return $cleanedTokens;

Would it be possible to integrate it?

Bye!

qzminski commented 2 years ago

It shouldn't matter if you send the messages right away, but if you are using a queue, then it is a bug in Notification Center: https://github.com/terminal42/contao-notification_center/issues/248