Order confirmation email after checkout with multiple items ordered

Hi, I am currently trying to use Sendgrid API to send an order confirmation email once the customer completes the order after checkout. My actual sending of a simple email is working fine but can somebody please advise how I can list the individual items that the customer has ordered within the body of the email?

The cart items are initially stored within a subcollection of users called 'cartitems'. When the order is placed I then create a new document in another subcollection called 'orders' which pulls in the cart items and order number and order total.

I thought I could create a string variable within the API call with a type of 'Is List' and then map the values in to the body of the email, however this does not seem to work.

Does anybody have any suggestions please?

Thanks

1 reply