Re: Send automatic email with specific details from Shopify flow to a customer

Send automatic email with specific details from Shopify flow to a customer

desireebethea
Excursionist
21 0 4

Re: I am using the results from a quiz to create a workflow to email customer recommendations.

 

The quiz provides recommendations to customers at the end. I was told that the quiz adds those recommendations in the form of tags to a customer's account, so I should be able to utilize them in a workflow to email their recommendations to them. I have attached the current workflow that I have created but it is not working. Does anyone have a suggestion about how to tell the workflow what products to add to the email for it to work? 

Quiz: Hair Consultation Quiz – Like Mother, Like Daughter Co. (likemotherlikedaughterco.com)

 

Thank you in advance!Screenshot 2024-08-14 133200.png

Replies 3 (3)

c_maiolo
Shopify Staff
4 0 3

Hi there,

It looks like you haven't entered any tags for the workflow to check.

It would be helpful to know what sort of tags the quiz adds, is there a unifying format those tags use (ex: they all start with "quiz-" like "quiz-shampoo")?

Depending on the case you may want to do something like check if any of the tags are at least one of a list of all possible tags, or if any of the tags start with "quiz-" or maybe you have a more complex use case where you want a drastically different type of email depending on the category of tags and need to have multiple condition paths. I've attached two examples of ways you may want to configure your condition.

Screenshot 2024-08-14 at 2.30.49 PM.png

Screenshot 2024-08-14 at 2.31.40 PM.png

To learn more visit the Shopify Help Center or the Community Blog.

desireebethea
Excursionist
21 0 4

Hi @c_maiolo

 

The quiz did not have a unified format, so I changed it to this format "Quiz-Fine". Then I added a tag for the quiz tags. (which I attached) And now my workflow looks like the other image attached. I am now at least getting a test email. Is there a way to import the products into the email? The final product should consist of an email draft with the products recommended from the quiz. Thank you for your assistance, I really appreciate it!Screenshot 2024-08-14 175318.pngScreenshot 2024-08-14 175242.png

c_maiolo
Shopify Staff
4 0 3

Hi @desireebethea 

You could use some custom liquid to extract the products from the tags. For example, if your tags have the format Quiz-12345 where 12345 is a product id, you could write something like this:

{% for tag in customer.tags %}
  {% if tag contains 'Quiz-' %}
    {% assign quiz_ID = tag | remove: 'Quiz-' %}
    {% assign quiz_GID = 'gid://shopify/Product/' | append: quiz_ID  %}
    
    {% for product in shop.products %}
      {% if product.id ==  quiz_GID %}
       {{product.title}} is a matching product. Do something with it
      {% endif %}
    {% endfor %}
  {% endif %}
{% endfor %}

To learn more visit the Shopify Help Center or the Community Blog.