Justin at ObjectiveHTML has been helping me out here but I think it might be time to see if anyone else has had some experience with this.
My client is selling two items. Item A requires an email be sent to the customer when the purchase is authorized with copies of the email sent to a set of additional recipients, let’s call them Set A. I’ve been using the standard CartThrob Notifications and EE mail and it is working.
Now, Item B is to be sold but, when purchase is authorized, an email is to be sent to the customer and to a different set of additional recipients, Set B. (Note: both Items can not be purchased in the same order.)
There didn't seem to be anyway to do this in CartThrob so I installed Postmaster. Postmaster has a "cartthrob_on_authorize" hook that will send out an email when a purchase is authorized. I was able to make that work equally well on Item A. (I figured out how to "turn off" the CartThrob Notifications, I'll put that in a note at the bottom.)
Postmaster also has a "Extra Conditionals" feature to do things like not send the email if the customer hasn't entered a full name. Justin thought that it would work to put this in to keep an email from being sent out when the product purchased was not, say, Item A. (Note: each item in the CT orders channel has an order_items CT field which is a matrix that includes an entry_id field which uniquely identifies a product. Item A's entry_id is 213.)
{if hook:entry_id != “213”}FALSE{/if}
Unfortunately, no email got sent out when I tried this. I tried various iterations of it including:
{if hook:item_options:entry_id != "213"}FALSE{/if}
and
{if hook:item_options:item:entry_id != "213"}FALSE{/if}
neither of which worked.
I'd certainly appreciate hearing from anyone who has successfully used the "Extra Conditionals" feature with the "cartthrob_on_authorize" hook.
I'm using the latest Postmaster version and 2.3.5 version of CT.
Thanks,
Jeanne
P.S. I tried setting "Log Email" to "No" in CT Notifications but that did not stop the emails. Justin gave me the hint to set up a "dummy" email which just means just leaving the email section as blank as possible.