Sort in email

DKhoo
Participant

Hi all! Hoping to get some help with a module I created, which we are using in a confirmation-style email to our customers.

 

Module:

{% email_each list="deal.line_items" item="line_item" %}
{% for item in email_each|sort(false, false, line_item.workshop_date) %}

 

<b>Workshop Date and Time(s):</b> {{line_item.workshop_date}} - {{line_item.start_time_s_}}<br>
<b>Number of Workshops:</b> {{line_item.quantity}} x {{line_item.delivery_method}}<br>
<b>Module:</b> {{line_item.business}} - {{line_item.name}}<br>

{% endfor %}
{% endemail_each %}

 

 

I was hoping the list would sort in order according to the line item table in the deal (we have sorted this by "line_item.workshop_date", however the order appears to be random so I added in a sort filter and enabled the programmable email beta in the module but am still having no luck. (In fact, after I added the sort in, the module stops populating info...)
 
Any idea on how I can get this to sort ascending by line_item.workshop_date? 
0 Upvotes
2 Replies 2
dennisedson
Community Manager

@himanshurauthan , can you assist with this one?

Thanks,

Dennis




Check out our Community Developer Blog
where we feature our Community driven developer podcast and how to content
0 Upvotes
DKhoo
Participant

Thanks @dennisedson!

 

 @himanshurauthan  - any tips to help would be amazing, thanks so much in advance.

0 Upvotes