Hey, I created a form that sends an email to a customer when filled in en submited. It works by adding a tag called ‘ebook_download’ to the customer. Then I have a shopify flow setup that listens to the event ‘customer tags added’ then checks for the specific tag ‘ebook_download’ and sends a trigger to klaviyo. The problem is that it only works for customers who’s email isn’t already in the customer files. So let’s say someone who already made an order or someone who is subscribed to the newsletter wants to fill in the form to get the ebook, we have to manualy add the tag in the customer files. This is ofcourse not ideal. Can anyone help me complete my code? Thanks in advance. P.S: I can send the styling for the code if there is a need for it.
{% layout 'page' %}
<div class="ebook-page">
<div class="ebook-form-container" style="background-image: url({{'marmer_bg.jpg' | asset_url}}); background-size: cover; background-position: top;">
<div class="ebook-image">
<img src="{{ 'pinepower-ebook.png' | asset_url }}" width="700" height="700" style="object-fit: cover;" alt="pinepower_ebook" />
</div>
{% form 'customer', id: 'ebook-form' %}
<div class="form-inner-wrapper">
<h1>Download hier je gratis E-Book</h1>
<div class="input-wrapper">
<div class="field">
<label for="ebook_first_name">Voornaam:</label>
<input class="text-input" type="text" id="first-name" name="contact[first_name]" placeholder="Voornaam" required>
</div>
<div class="field">
<label for="ebook_email">Email:</label>
<input class="text-input" type="email" id="email" name="contact[email]" placeholder="Email" required>
</div>
</div>
<input type="hidden" name="contact[tags]" value="ebook_download">
<button type="submit">Verstuur gratis E-Book</button>
</div>
{% endform %}
</div>