Skip to content

[Notifier] Allow MessageOptions in SmsMessage #48254

Closed
@leblanc-simon

Description

@leblanc-simon

Description

Most of SMS providers allow some options in their API (like priority, encoding, sending date, short links, ...) and usually this options must be specifics to each SMS (not, globally, for all SMS sent)

Actually, only ChatMessage and PushMessage can have options. Recently (for 6.2), SmsMessage can have a "from" (#45987).

It would be interesting to have the possibility of adding additional options. I can propose a PR but I would like to know if:

  • we add the options in 4th parameters
  • we replace (BC) the "from" by the options and we modify the code of all notifiers to take account of this change

Example

Before :

$smsMessage = new SmsMessage('+3312345678', 'subject');
$texter->send($smsMessage);

After :

$smsMessage = new SmsMessage('+3312345678', 'subject');

$options = (new OvhCloudOptions())
    ->setPriority('high')
    ->setFrom('sender') // Maybe move "from" with options
;

$smsMessage->options($options);

$texter->send($smsMessage);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions