memius
memius

Reputation: 4125

How to use Heroku Review Apps with Twilio?

When a new Pull Request is created for our app, a new Heroku instance is spun up, with a new, unique URL each time.

However, the app needs to handle incoming text messages, which requires that we specify a callback URL in the Twilio dashboard.

Is there a way to solve this catch 22?

Upvotes: 1

Views: 57

Answers (1)

philnash
philnash

Reputation: 73057

Twilio developer evangelist here.

I have not worked with Heroku Review apps myself, so I'm not sure, but here is an idea to follow up on.

The Heroku Review app allows you to specify a post-deploy script that runs once the app is deployed. I don't know if you can get the URL for the new application within that post-deploy script or the environment, but if you can, you can then make a call to the Twilio API to either create a new phone number and set it's SmsUrl or update an existing phone number's SmsUrl to the new application's URL.

Upvotes: 1

Related Questions