How to Delete Emails from SendGrid List After Stripe Subscription Cancellation?

This topic was automatically generated from Slack. You can find the original thread here.

Hi guys, trying to delete members’ emails off of a sendgrid list once they cancel their stripe subscription. For some reason I can’t find the email parameter. What am I missing?

Hi , may I ask what specific field from which trigger/step that you want to reference to?

Are you trying to manually type in an email address, or reference one/some from a previous step?

Hi , see if the screenshot helps?

trying to automatically reference one from a previous step (specifically, the stripe customer that would’ve canceled their subscription

not helping much for now. Do you see any event from stripe? If not, could you try to create a test one (.i.e having a test subscription and cancel it)?

Yes, trigger from stripe coming back positive I think

Okay, so now you’ll need to find the field having the value of customer email in the event. Can you find it?

Correct, but can’t find it

Okay, then I think the event data doesn’t have the email, can you find the customer id though (with the format similar to cus_Jz4ErxGo9t1agg)?

Yes! How should I proceed?

Nice! Then you can add another Stripe step Retrieve a Customer right below to the Stripe trigger. Then in the action > Customer ID prop, reference to the Customer ID variable in your trigger

The Retrieve a Customer action should give you the customer email I think

Almost had it, was able to reference email but this error came up?

Hi , could you share screenshots of your whole sendgrid action?

Could you try to change your Contact Emails to

{{ [steps.retrieve_customer.$return_value.email] }}

Notice the square brackets.

This is because the prop expect an array

:thinking_face:

Hmm this is weird. I think we’ve found a bug here. I’ll submit a ticket for it

look at the end of the error message, about contact_ids being a required param. Seems srange to me, but I guess you have to look up the contact IDs in Sendgrid first, then also specify that?