How can I automatically tag customers who subscribe to my newsletter?

So here’s the case, I want to create a discount code to our registered acc and those who subscribed to our newsletter.

Here’re a few scenerio.

  1. subscribed to our newsletter while creating an account.

  2. subscribed to our newsletter and create an account later

  3. created an account and subscribe to our newsletter later.

  4. remove the tag when the customer unsubscribes to our newsletter

How do I auto-tag these customers?

so as long as they have an account and sub to our newsletter then that specific tag will apply on them.

I think you’ll need to have your email marketing software handle this, they might have the feature.

For example, with an app you can add / remove customer tags when certain events happen. In your case the event happens with your email software, so when they get that event, they can make the API call to your customer to remove the tag.

I would contact your email software provider and ask them “do you have the ability to remove a customer tag in Shopify if there is a customer with the email address that unsubscribed from the newsletter?”

It’s probably unlikely because they would have to search all your Shopify customers to see if the email address matches, but might be worth a try.