I’m using cartThrob and allowing customers to purchase a virtual product for a friend (gift cards). I’m NOT using the cartThrob gift cards for this project.
As of now… when a user wants to send a product to a friend - it’s added as a item option when they add it to their cart with the friend’s email address.
When the order is complete… I’d like to send an email/gift card to any recipients in the item:options.
I’m already using the cartthrob hook for order notifications/etc…. but these emails need to be initiated from either
1: within the normal customer notification template in Postmaster
OR
2: from the order confirmation page
One the surface, it seems like I should initiate the emails from the order confirmation page and use the postmaster trigger tag. I would need to pass along the gift recipients email addresses.
The logic on the confirmation page would be….
{order_items} {if "{product_options_other}" == "email_friend"}
{exp:postmaster:trigger subject="You've received a gift" entry_id="{entry_id}" recipient="{item:mail_email}" } {hook:entry_id}<br> {hook:title}<br> {hook:url_title} {/exp:postmaster:trigger}
{/if} {/order_items}
Is this the right idea? How can I define which hook to call… I may have multiple trigger hooks in this project. Or… maybe I’m misunderstaing the trigger hook all-together.
Any help/insight appreciated.
Thanks!
|