Sendgrid CoPilot Plugin best practice for retrieving delivery status and information

I’m leveraging the following plugin - SendGrid Plugin | Bubble (thanks @copilot for building a great solution)

Now that I have a few customers sending many emails through my app, they of course want to know the delivery status of those emails and the reasoning for any failures. I’ve looked into the sendgrid webhooks but am hesitant to commit to that approach as it requires I store thousands of records for each email unnecessarily (many emails from my app are a single communication being sent to hundreds of email addresses).

I’m wondering if a single get call to bring back a json response to then store on a record is a more effective way to solve for this.

Set up:

  • I have an object called Communication
  • When the user sends out a communication, I create a communication record and schedule the email on a list of email addresses (and include the communication id as a custom argument)
  • I now want to get the related emails that were sent and display the status (and other supporting information i.e. failure to deliver reason, etc) of them to the end user.

I’m thinking about implementing a Get api call using their documentation, filtering by the communication ID, and storing the json response in a text field to then reference. It seems a $12/month add on is required (purchased via sendgrid) to do this in addition to some research.

Two questions:

  • Anyone have suggestions for how to potentially solve for this more effectively?
  • @copilot - It would be great if there was a simple “get email status” action or something similar to retrieve the data without having to tackle that particular api call separately. Is that something that you could potentially add?

Sendgrid has webhooks for events such as sent, delivered, bounced, opened.

This tends to be the best way to manage these emails.

Thanks for the reply @chris.williamson1996! My concern with this approach is that I’d be required to store hundreds or thousands of “email records” in my app even though it’s really only a single email being sent to hundreds or thousands of email addresses. This would also cause many webhook events as well when those emails are interacted with, which I believe will increase the workload of my app a non-insignificant amount… right?

What I’d like to be able to do instead is to make a single call for all email events associated to a blast communication. If a user is sending a communication emails to 1000 emails for instance, my app would fire 1000 workflows for each webhook event when in reality the user will only want to view those email delivery results 4 or 5 times max.

You can retrieve it with get calls as well, although every email will still have its own status to update even though it’s a bulk send. Ex) 100k sends still requires 100k status pulls.

I’d assume for your case best bet is to make a get call that is a data call not an action, drop it in the RG of emails being displayed. This way it’ll only call for what the user is viewing rather than the whole 100k emails.

Hey @gpdmop,

Thanks for the shoutout! We love seeing the community leverage the SendGrid plugin, and now we migrated the actions into one universal action that’s also more performant!

We’ll see if we can squeeze in the email status call in the next update. :wink:

My hopes are officially up, thank you for considering!