Suggestions for sending email to third party merchant when checkout is completed I need to build a site that will sell products on behalf of merchants referenced on the site and I need to notify these merchants every time a sell of their products occurs and send them information about the order we received for their product. Out of the box, commerce uses rules to send an email to the buyer and can also notify the site admin that a new order was created.

That is great but what if I need to notify a third party? Is there a way to do this out of the box or via configuration? Or is there a module for that?
I have been looking and couldn't find anything. When I try to use rules the only email available for order checkout as tokens are the customer email and the site admin email.

For the sake of clarity here is the setup I have gone for so far and where I am stuck:

I have setup a field collection on my product pages listing the contact details for the merchant selling the product.

I collect three fields information inside the field collection:


name of merchant 
address 
contact email


I can easily make them visible on the order form with views by using relationships but I need to make the contact email available to rules so that I can set up a rule that will send and email to the merchant when the checkout process is completed.

That's it.

Thanks for your help
You can use a rule for that.

Use the action "Send a mail to an arbitrary mail address"

Set the recipients with php, like this (it's more powerful than tokens) :

&lt;?php print _get_custom_emails_list( $node-&gt;field_custom );?&gt;


Add this custom function in your custom module

&lt;?php
// Your custom function
function _get_custom_emails_list( $field_custom ){
  // your query here.....
  return 'test@test.me, test2@test.me'    
}
?&gt;