Can't edit customer tags if accepts_marketing is set to true?

Pachooca
New Member
1 0 0

Hello there (first time posting on forum, so if anything isn't ok, please let me kno)

Update #1: Sorry for the poor formatting, I can't seem to insert liquid code correctly...

My main problem is that I want to edit the customer tags via a "subscribe to newsletter" form (form A) AND offer advantages to customers if they enter their email onto form B.

I see a problem (after multiple tests), when the accepts_marketing is set to "true", I can't edit the tags for a customer.

Ex: If I subscribe via the form A (a customer is created), and I want to get the advantages offered via the form B, the 2nd tag won't apply...
(If I manually disable the accepts_marketing via the admin for the customer, then it would work... kinda weird!)

Here's the code for the 2 forms:

{% form 'customer', id: 'newsletter_form' %}
<input type="hidden" name="contact[tags]" value="Infolettre">
<input type="email" name="contact[email]" id="email-address" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}">
<button type="submit">
{% endform %}

{% form 'customer', id: 'newsletter_form' %}
<input type="hidden" name="contact[tags]" value="Club privilèges">
<input type="email" name="contact[email]" id="email-address" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}">
<button type="submit">Devenir membre</button>
{% endform %}

I tried adding the following line in the form section, but no success:
<input type="hidden" name="contact[accepts_marketing]" value="false" id="marketing" />

All in all, I want my customer to whatever form they fill, the tags update accordingly.

0 Likes