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

3rd party Twilio provider, multiple accounts #96

Open
clod986 opened this issue Apr 29, 2020 · 5 comments
Open

3rd party Twilio provider, multiple accounts #96

clod986 opened this issue Apr 29, 2020 · 5 comments

Comments

@clod986
Copy link

clod986 commented Apr 29, 2020

I would like to use this package to run multiple Twilio accounts on my website; each account is managed by one of my users. Basically I'm looking into becoming a 3rd party provider for Twilio.

How can I achieve this if the configuration gets pulled from a static .env file?

I guess I have to find a way to bypass the general booting in the TwilioProvider class

$this->app->bind(TwilioConfig::class, function () {
    return new TwilioConfig($this->app['config']['twilio-notification-channel']);
});

and rebuild the TwilioConfig for each TwilioMessage I'll be sending. Is this correct? How can I achieve this?

@bbeng89
Copy link

bbeng89 commented Jul 2, 2020

I am also looking to do this but with subaccounts, which also have their own SID and Auth Token. It looks like in the toTwilio method, I can do return (new TwilioSmsMessage())->applicationSid($mySid)) to provide an SID dynamically, but I don't see a way of providing the Auth Token. Anyone know if there's a good way to do this?

@atymic
Copy link
Member

atymic commented Oct 4, 2020

Would be happy to accept a PR that allows you to set the auth creds on a message basis 👍

@athphane
Copy link

Hi. Any possible future release with this feature? PRs for this still welcome?

@danielcharrua
Copy link

Same here, would like to use subaccounts on the same Laravel app but can't find the way to provide the auth token as it's loaded from the twill provider. Any ideas?

@lrljoe
Copy link

lrljoe commented May 29, 2023

If you're still interested in an approach for per-user config then let me know as there's a fairly straight forward way of doing it.

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

No branches or pull requests

6 participants