Shopping Cart: Final Step - The Customer receipt

How do you handle a repeat region in the email?

I will take a moment to digest your reply. Thanks so much!

1 Like

See the link in my previous reply about how I did the repeat region in the email:

Thanks @sitestreet! I now am sending an email to user and myself in the endpoint! Thats a huge step!

I am very confused on what you are doing in your email body though. You have setValue OrderDetails four times in the same action? If I can get the line items to show up in an email I will be a very happy camper!

Alternatively I can now at very least supply a link to where users can view and print out order details.

But would love to have that right in the email body!

1 Like

I have it three times because each time it’s appending to the existing value. You’ll see the Set Value actions begin with {{OrderDetails}} or {{$parent.OrderDetails}} which outputs its existing value so I can then append to it.

So the first time it sets the value with the opening HTML for the table including the column headings. Then it appends a row for each loop of the repeat and finally it adds the closing HTML to end the </table> tag. So the value stored is the complete HTML for a table with all its contents. I can then just output that value in the email body.

Interesting. Ok, I think I see what you are doing in theory. How do you get this into the body of the email though in the mailer step?

Just insert the variable using the lightning button like you would any other variable. In my case it inserts {{OrderDetails}} into the body.

So the email body could be something like this:

Dear {{firstName}}

Thank you for your order. Here are the details.

{{OrderDetails}}

Kind regards

Shop owner

For some reason I am not getting my line items in the email.

Screen Shot 2020-09-06 at 11.52.52 AM

Here is my action step:

Here is my setValue:

Your repeat is referring to querySummary which I would have thought would be the actual order summary (customer details, order total, Stripe data, etc.) rather than the actual line items. Am I right? Or have you just called it that but it does contain all the line items? I normally go with orderSummary for the totals and orderDetails for the line items.

Can you post a screenshot of the querySummary query?

The querySummary is the line items.

That all looks good to me so I can’t really see why it’s not working. line_order_id is the payment intent from Stripe I assume? My thinking is it’s the query not returning data which is the issue.

1 Like

Yeah, I will keep working on it. I get what you are trying to do. Just a matter of me figuring it out.

Just about time for :beers:. That will help. :wink:

1 Like