John Kuriakose
John Kuriakose

Reputation: 7241

Can we have separate URL set up for sendgrid webhooks for different environment like Test, Stage and Prod

I am trying to setup sendgrid webhooks for events fired when the emails are delivered etc. Is there a way to pass a URL like twilio or any other setting changes that allow me to add more URLS for different environments.

I am also trying to differentiate between test and prod.

For example -


Test - test.callmebackwithInfo.com/sendgrid


Stage - stage.callmebackwithInfo.com/sendgrid


Prod - prod.callmebackwithInfo.com/sendgrid

Upvotes: 6

Views: 2758

Answers (2)

John Kuriakose
John Kuriakose

Reputation: 7241

After call with send grid and from the answers below. I added more sub-accounts. With each subaccount I can add different URL's.

The good thing is I can use the same email address with different username.

Upvotes: 4

Subhrajyoti Das
Subhrajyoti Das

Reputation: 2710

You cannot add 3 URLs or let Sendgrid decide where to call on the basis of your environment. However, your requirement is doable and below are 2 ways to achieve your requirements.

  1. Set up 3 different Sendgrid accounts. This way for each environment you will have different webhook.
  2. If you want to use one Sendgrid account for all of your environment, then you have to handle the webhook calls from Sendgrid and as per the environment set by you while calling the Sendgrid API yo would have to forward those calls. While calling Sendgrid API you can pass the environment in a unique argument and read the same when Sendgrid call you whenever any activity is done.

Upvotes: 2

Related Questions