Skip Navigation

[Resolved] Email to post author

This support ticket is created 5 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1139514

Hi Luo,

I've the last question on my process.
If you remeber I built a booking process from an accommodation custom post type.

I used CRED to set the price of a product, and clicking on the button the product is added to the cart.

Everything works very god.

My problem now is only the last email, when the order is complete. By default woocomeerce send the email as set in the woocommerce email setting.

But I need to send the email to the author of the custom post accommodation.

How can I do?

#1140175

Hi,

I assume we are talking about a Toolset post form for creating "booking" post, as you can see this "order is complete" email is sent by Woocommerce plugin, so there isn't such a built-in feature within Toolset form plugin, it needs custom codes,
Here are my suggestion, you can try with filter hook "woocommerce_email_recipient_new_order", see similar thread:
https://wordpress.stackexchange.com/questions/312677/cannot-add-additional-receipient-to-woocommerce-emails

More help:
https://docs.woocommerce.com/wc-apidocs/source-class-WC_Email.html#351

Is there any relationship between post type "accommodation" and "booking", if there isn't, I suggest you setup one- post type relationship between them, then in the "order completed" email , you can get the "booking" post ID as this:
https://toolset.com/forums/topic/how-add-the-meta-also-to-the-woocommerce-order/#post-1118111

Then get "accommodation" post ID with function toolset_get_related_post()
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.