Discussions

Order summary email

Hello,

I hope someone could help me. I search for a while on google for my issue but without any success.

I have to send an email to the customer after the checkout is completed. The rule is working as it should and the email will be send.

But in the email should be an order summary (table of order line items included custom fields, like image, aso).

How can i get the line items as a table in this email (variables ???)

THANK YOU
Kind regards,
Ron

Posted: Jun 5, 2012

Comments

DrupalAbility on December 4, 2012

First, please ensure that the line items you want displayed in the e-mail corresond with the display view selected. It is a huge problem that unless you pay attention you will be configuring your display for a 'default' display. So you will spend hours wondering why your modifications do not appear. It sounds to me like in your situation will be some display tab 'email' or something. Try that... if it does not work let me know and i will continue to troubleshoot your problem. Cheers Kevin

Lance Holland on October 28, 2013

I have the same problem. I have added a rule to send an email after checkout. I can even get some of the order data to display e.g. If I put the following in the rule:

===================================================================
Order [commerce-order:order-number] has been received
Label: [commerce-order:commerce-line-items:0:label]
Quantity: [commerce-order:commerce-line-items:0:quantity]
Product Reference: [commerce-order:commerce-line-items:0:product]
Line total: [commerce-order:commerce-line-items:0:commerce_total]
Date Required: [commerce-order:commerce-line-items:0:field_date]
Shipping: [commerce-order:commerce-line-items:0:commerce_shipping_service]

Label: [commerce-order:commerce-line-items:1:label]
Quantity: [commerce-order:commerce-line-items:1:quantity]
Product Reference: [commerce-order:commerce-line-items:1:product]
Line total: [commerce-order:commerce-line-items:1:commerce_total]
Date Required: [commerce-order:commerce-line-items:1:field_date]
Shipping: [commerce-order:commerce-line-items:1:commerce_shipping_service]

Order Total: [commerce-order:commerce-order-total:amount-decimal]

I get the following output:
====================================================================
Order 8 has been received
Label:
Quantity: 1.00
Product Reference:
Line total: £64.94
Date Required: 2013-10-28 00:00:00
Shipping:

Label:
Quantity: 1.00
Product Reference:
Line total: £2.95
Date Required:
Shipping: priority_service_1

Order Total: 67.89

How do I get it to output all the line items? I obviously don't know in advance how many line items there are going to be. Is there a way to say "display all the line items"?

RiBu-Nezz on November 12, 2013

I don't know if you have found the solution. I think if you type !order-summary it will retrieve all the line items in order.

But the only problem I have and still can't find the solution is in the confirmation order email the table is gone so you need to find the way to style it.

Lance Holland on November 12, 2013

Take a look at this discussion http://www.drupalcommerce.org/questions/10636/how-do-i-add-custom-line-i.... You can use the Token Embed Views module to embed a custom layout which you can then style with css. I haven't actually got as far as styling mine yet but I've got the email displaying as a table. If you look at commerce kickstart they use css to style their email. I think you can use emogrifier module to convert your css to inline css.