Creating a Flow to Remove Email Marketing Preferences After Bounces

Hi

I am looking to create a flow to automatically remove customers email marketing subscription preferences

I have created a segment for when a customers email address has bounced 2 times

I want the trigger on the flow to be that when a customer join this segment.

But is there anyway to automatically edit in the flow the customers email preferences to unsubscribe them from email marketing in shopify email?

Thanks

You might be able to unsubscribe them using the customerEmailMarketingConsentUpdate mutation with the Send Admin API request action.