Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracking / shipping to emails #1761

Merged
merged 3 commits into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion imports/plugins/core/orders/client/templates/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Template.orders.onCreated(function () {
// fetch available orders
this.autorun(() => {
this.subscribe("Orders");
const filter = this.data && this.data.filter.name || Reaction.Router.getQueryParam("filter");
const filter = this.data && this.data.filter && this.data.filter.name || Reaction.Router.getQueryParam("filter");
const query = OrderHelper.makeQuery(filter);
const orders = Orders.find(query).fetch();

Expand Down
16 changes: 8 additions & 8 deletions private/email/templates/orders/new.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@
<td align="left" valign="top" height="25" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Your Order</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Order Date</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">&nbsp;</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Your Order</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Order Date</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Status</td>
</tr>
</tbody>
</table>
Expand All @@ -184,18 +184,18 @@
<tr>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#1999dd; font-family:Arial, helvetica;"><a href="{{homepage}}{{orderUrl}}" style="color:#1999dd;">{{order._id}}</a></td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">{{orderDate}}</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">&nbsp;</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Not shipped</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="left" height="13" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="20" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>

<tr>
<td valign="top" align="left" height="13" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="20" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">
Expand Down Expand Up @@ -232,10 +232,10 @@
<td width="33%" align="left" valign="top" style="font-size:10px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">{{billing.paymentMethod}}</td>
</tr>
<tr>
<td valign="top" align="left" height="30" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="40" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Item(s)</td>
<td valign="top" align="left" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Item(s)</td>
</tr>
</tbody>
</table>
Expand Down
12 changes: 6 additions & 6 deletions private/email/templates/orders/refunded.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
<td align="left" valign="top" height="25" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Your Order</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Order Date</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Your Order</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Order Date</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">&nbsp;</td>
</tr>
</tbody>
Expand Down Expand Up @@ -191,11 +191,11 @@
</td>
</tr>
<tr>
<td valign="top" align="left" height="13" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="20" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>

<tr>
<td valign="top" align="left" height="13" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="20" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">
Expand Down Expand Up @@ -232,10 +232,10 @@
<td width="33%" align="left" valign="top" style="font-size:10px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">{{billing.paymentMethod}}</td>
</tr>
<tr>
<td valign="top" align="left" height="30" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="40" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Item(s)</td>
<td valign="top" align="left" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Item(s)</td>
</tr>
</tbody>
</table>
Expand Down
20 changes: 12 additions & 8 deletions private/email/templates/orders/shipped.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@
<td align="left" valign="top" height="25" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Your Order</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Order Date</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">&nbsp;</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Your Order</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Order Date</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Tracking Number</td>
</tr>
</tbody>
</table>
Expand All @@ -184,18 +184,22 @@
<tr>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#1999dd; font-family:Arial, helvetica;"><a href="{{homepage}}{{orderUrl}}" style="color:#1999dd;">{{order._id}}</a></td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">{{orderDate}}</td>
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">&nbsp;</td>
{{#if shipping.tracking}}
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">{{shipping.carrier}}<br />{{shipping.tracking}}</td>
{{else}}
<td width="33%" align="left" valign="top" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Tracking not available</td>
{{/if}}
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td valign="top" align="left" height="13" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="20" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>

<tr>
<td valign="top" align="left" height="13" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="20" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">
Expand Down Expand Up @@ -232,10 +236,10 @@
<td width="33%" align="left" valign="top" style="font-size:10px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">{{billing.paymentMethod}}</td>
</tr>
<tr>
<td valign="top" align="left" height="30" style="line-height:1px; font-size:1px;">&nbsp;</td>
<td valign="top" align="left" height="40" style="line-height:1px; font-size:1px;">&nbsp;</td>
</tr>
<tr>
<td valign="top" align="left" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica;">Item(s)</td>
<td valign="top" align="left" style="font-size:14px; line-height:normal; color:#4c4c4d; font-family:Arial, helvetica; font-weight:bold;">Item(s)</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 2 additions & 0 deletions server/methods/core/orders.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ export const methods = {
orderDate: moment(order.createdAt).format("MM/DD/YYYY"),
orderUrl: getSlug(shop.name) + "/cart/completed?_id=" + order.cartId,
shipping: {
tracking: order.shipping[0].tracking,
carrier: order.shipping[0].shipmentMethod.carrier,
address: {
address: order.shipping[0].address.address1,
city: order.shipping[0].address.city,
Expand Down