Prevent Registration Email From Being Send If Customer Is Registered Using The REST API In Shopware 6

Viewed 111

How can I prevent the registration email from being send if a customer is registered using the REST API (storeurl/store-api/account/register)? I already did try to set the flag "acceptedDataProtection" to true.

I am trying to register our customers from another database to shopware, therefor they already have accepted the data protection and should not be receiving an email telling them that they have to opt-in again.

2 Answers

Just add a tag to that customer like "migrated" and then check via rule for tag != migrated in the flow builder. There should be an entry for the registration event. This would be the easiest way and also the one without any additional individualization needed. You can also check for the sales channel, when using the headless sales channel for the registrations and exclude it.

I have tried the @mnaczenski solution, but Flow builder did not work with Customers Tags: it ignores all tags, as there were no tags at all. Not sure why.

But same Flow builder idea worked well with another conditions:

  1. Create a customer group and assign customers to that group, then condition is: Customer group | Is one of | Do Not Send Mails Group.
  2. Create a custom field and give a value of that field for every customer, then condition is: Customer with custom field | do_not_send_me_registration_email | Is equal to | true

I prefer 2) solution with custom field, because in this case customers API payload does not need additional Ids (for customer group), just "customFields":{"do_not_send_me_registration_email":true}

Related