Emailing 3Rd Party Review Service, Order Completed Emails Only?

So when marking an order completed there is the option to notify the customer and order department (always checked). I somehow need a 3rd option to email a 3rd party service is there an easy way??

It is a small amount of custom development to utilize one of the 'send_mail' hooks. I.e. you could add a BCC to the current email or send a copy. But if this is a standard thing you're wanting to do I would go about it a bit differently that requires no modifications to anything.

Go into your cpanel account (or wherever you receive your email) and create a forwarder for 'my_orders@[your_domain.com]' that would go to whatever list of addresses you want. Then you'd just set your 'orders department' email setting to 'my_orders@[your_domain.com]'.



No modifications to anything required.

Hmm, but we only want this to happen for order completed emails and not order confirmation emails?

As alternative, you can use the change_order_status hook in the fn_change_order_status function (app/functions/fn.cart.php) and send additional notification using standard methods

Ditto Ecom…



Or if you wanted to get fancy, you could set a registry value in the change_order_status hook when the status is what you want and then in the send_email hook, look for the flag and add the BCC. This would actually be the most robust way to deal with any BCC need since the flag would be recognized for even non-order events if desired in the future.

[quote name='eComLabs' timestamp='1423129750' post='204373']

As alternative, you can use the change_order_status hook in the fn_change_order_status function (app/functions/fn.cart.php) and send additional notification using standard methods

[/quote]



So back to this one, where is the mail functionality here in this file in this function??

Have you looked at the arguments passed to the two hooks that were suggested?

[quote name='amdowney' timestamp='1424806112' post='206323']

So back to this one, where is the mail functionality here in this file in this function??

[/quote]



You can find the example in the fn_order_notification function which is called from the fn_change_order_status one

So nearly there…



i have:



$order_status = $order_statuses[$order_info['status']];



// Notify customer
if ($notify_user == true) {

if ($order_status == 'C')
{
$toemail = $order_info['email']. ', 3rdparty@email.com';
}
else
{
$toemail = $order_info['email'];
}




But the status is not checking correctly as $order_status is an array so what does this need adjusting to??

$order_info['status']

[quote name='tbirnseth' timestamp='1425333866' post='206847']

$order_info['status']

[/quote]



Ah that's the one, also is there an easy way to check which store this order is for here?



edit ---------------



Ah I think I've found it: $order_info['company_id']



Thank you so much!

$order_info['company_id'].



Suggest you look at the structure of an order by doing a

echo "
".print_r($order_info,true)."
";

Yeah like I said above, just found it… the last piece to this puzzle is printing the customers email in the confirmation that goes to the 3rd party address, so they can later email them.



I see in invoice.tpl under {if $profile_fields.C} it prints the email. So is there a setting I can't find in the admin to print this extra customer info? That's if this is the right template…

You do know that our Auto Mailer addon will do all of this automatically for you (mail customer at some time in future) and the email can be an inline form that they just fill out and send or links to your reviews page.



It works with the internal cart discussions addon for reviews. It does not work for 3rd parties. You might want to check it out and save yourself a boat-load of time.