-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Description
Some Api like the AllMySms return informations like total of sms sent or the cost. Api
It should be great if we can get those informations in the Notifier SentMessage class.
In the SentMessage of Mailer there is a debug property. I suggest to add this property in the SentMessage of the Notifier componant and to update bridge transport like AllMySmsTransport to update this property.
Maybe debug property is not the best property.
Thanks.
Example
namespace Symfony\Component\Notifier\Message;
class SentMessage
{
private MessageInterface $original;
private string $transport;
private ?string $messageId = null;
...
private ?array $debug = null;
...
public function getDebug(): array
{
return $this->debug;
}
public function setDebug(array $debug): void
{
$this->debug = $debug;
}
...
namespace Symfony\Component\Notifier\Bridge\AllMySms;
final class AllMySmsTransport extends AbstractTransport
{
...
protected function doSend(MessageInterface $message): SentMessage
{
...
$success = $response->toArray(false);
...
$sentMessage = new SentMessage($message, (string) $this);
$sentMessage->setMessageId($success['smsId']);
$sentMessage->setDebug($success);
...
}
}