Hell
I'm trying to configure Workflow-NG to send an order update email only for order status = "payment_received".
The built in admin notification sends an email with status "in_checkout", which won't work in my situation. Our fulfillment house prefers to receive email notification of orders. But we only want to send this notification when order status = "payment_received".
I'm using this code as a custom PHP execution when an order status gets updated, the script works fine expect for the sku and quantity, and I haven't been able to find order tokens for this:
<?php
$to = "clint.eagar@gmail.com";
$subject = "Order Notification Test";
$body = "
Order Number:
[order:order-id]
Date Ordered:
[order:order-date-created]
Status:
[updated_order:order-status]
Name:
[order:order-first-name] [order:order-last-name]
Shipping Name & Address:
[order:order-shipping-address]
Email address:
[order:order-email]
Item:
if (is_array($order->products)) {
foreach ($order->products as $product) {
echo $product->qty; x
if (is_array($product->data['attributes']) && count($product->data['attributes']) > 0) {
foreach ($product->data['attributes'] as $key => $value) {
echo $value;
}
}
echo $product->model;
}
}
Comments:
[order:order-comments]
"
;
if (
mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>Any ideas?
