-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Twilio customized to phone number #119
base: master
Are you sure you want to change the base?
Twilio customized to phone number #119
Conversation
Add method in message base class to override to number in message
@@ -56,6 +54,9 @@ public function send($notifiable, Notification $notification) | |||
throw CouldNotSendNotification::invalidMessageObject($message); | |||
} | |||
|
|||
$to = $this->getTo($notifiable, $notification, $message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented on the last PR, but shouldn't we merge the additional tos instead of overridding?
Also, could you fix the tests please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
We shouldn't. As the notification is overriding the default phone number, we should not send also to the primary number defined in the model. But we can have one ->addTo([]) method to add list of phone numbers on primary phone or the phone number provided in the ->to() method.
-
I am working on the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened with this PR? If this is not going anywhere, can I make a PR with proper tests for this patch?
Issue: #118
To() method will allow developers to add phone numbers dynamically from the notification itself. If the user needs to use different phone numbers for different notifications, it will help a lot.
This is just to check if any recipient number is provided in the message itself. If provided, this means the developer wants to override the notifiable user's phone number.
And if not overridden, then we can safely use the notifiable's phone number as it was before.