Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

skybitbbsr
Copy link

@skybitbbsr skybitbbsr commented Mar 3, 2021

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.

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);
Copy link
Member

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?

Copy link
Author

@skybitbbsr skybitbbsr Mar 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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.

  2. I am working on the tests.

Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants