Loop trough quantity of a product from shopify

Describe the problem/error/question

Goal:
When a customer buys a ticket they need to get a seperate e-mail for every ticket with a unique password.
They can buy multiple tickets of the same event and therefore need multiple e-mails with the password of said ticket that is generated on the backend.

This the workflow i have now:

  1. Trigger: shopify pay event → Working
  2. Split into single products → Working
  3. Call backend to create a ticket for every product * quantity of said product
  4. Generate email and send it with the username and password to customer → shouldn’t be difficult :slight_smile:

What works is to loop over every line item without the ‘loop over items’ node.

But how do I loop trough the products, and then for every product use the quantity variable to generate the number of tickets?

Data:
line_items (products)
__ ID
__ ProductName
__ quantity: x (the number of said product I want to generate tickets for)

Something like this:

Edit:
So this works until the send email part (it doenst send mails using the exact same credentials as my mail client…)

So i now have 2 questions!

  1. 2 products with QTY 2? 22 tickets has te be generated and 22 emails send
  2. Sending email does not work??

i am using the online version of N8N by the way!

Thanks in advance!

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

When you say 22 emails has to be generated are you saying it should generate 22 emails or you are only expecting one email and what do you mean by sending email does not work is there an error message at all?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.