symfony / symfony

The Symfony PHP framework
https://symfony.com
MIT License
29.62k stars 9.42k forks source link

[Notifier][FakeSMS] Notifications don't appear in profiler #52919

Closed disstudio closed 9 months ago

disstudio commented 9 months ago

Symfony version(s) affected

6.3.5

Description

Notifications sent are visible in "Logs" and "Emails" tab New SMS on phone number: +123456 Emails are successfully sent

But there is no records in "Notifications" tab

How to reproduce

config/packages/notifier.yaml

framework:
    notifier:
        chatter_transports:
        texter_transports:
        channel_policy:
            # use chat/slack, chat/telegram, sms/twilio or sms/nexmo
            urgent: ['sms/sms']
            high: ['sms/sms']
            medium: ['sms/sms']
            low: ['sms/sms']
        admin_recipients:
            - { email: admin@example.com }

when@dev:
    framework:
        notifier:
            texter_transports:
                sms: '%env(FAKE_SMS_DSN)%'

env.local FAKE_SMS_DSN=fakesms+email://default?to=my.email@gmail.com&from=${MAILER_FROM}

Sending sms

$notification = (new Notification($content, ['sms/sms']))
    ->content($content);

// The receiver of the Notification
$recipient = new Recipient('', $phone);

// Send the notification to the recipient
$this->notifier->send($notification, $recipient);

Possible Solution

No response

Additional Context

No response

xabbuh commented 9 months ago

Can you create a small example application that allows to reproduce your issue?

dfridrich commented 9 months ago

For me it works as expected.

You have 2 choices when using FakeSMS notifier, first is fakesms+email which shows in the debug toolbar as email notification (see image below) and second is fakesms+logger which shows only log message (second image).

image image
xabbuh commented 9 months ago

I am going to close here for now due to the lack of feedback. Please let us know when you have more information and we can consider to reopen.