Skip Navigation

[Resolved] In the email notification setting in postform

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)

This topic contains 26 replies, has 4 voices.

Last updated by Luo Yang 7 months, 3 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#2380977
access control.png
post form.png

Tell us what you are trying to do?
I want to send a thank-you email to a member after paying the membership fee

Is there any documentation that you are following?
Currently, there is no documentation as far as I've searched.

Is there a similar example that we can see?

What is the link to your site?
hidden link

#2381307

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I see you set the purchase processing setting to "Pending Review" and you suppose to complete the order from the backend but when you complete the order from backend there will be no access to the frontend product information.

What if you try to add the following hook that should be called after successful payment and when it displays the thank you page where we set the order as completed:

add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}

$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
}

What should happen now is it will set the order status to 'completed' and it should run the email notification.

#2381345

Dear minesh,

Thank you for contacting me.
I can't read and understand the code.
I'm very sorry.

Perhaps what you are explaining offers me a straightforward solution. However, I have no technical skills at all.

Can you tell me what I should do to solve my problem?

Regards,

Yoshihiko

#2381351

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You should create a custom code snippet using Toolset:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset

And then add the following code to the code snippet you created:

add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
 
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
}

And then try to make a test purchase and see if notification works as expected.

#2381355
postform-3.jpg
postform-2.png
postform-2.png

Dear minesh,

I will attach an image.
Does your suggestion point to the settings in the image (postform-3)?
If you're referring to postform-3, you've already tried it. And it didn't work.

Regards,

yoshihiko

#2381381

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

No.

You should create a custom code snippet using Toolset, please try to follow the following Doc to create custom code snippet:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset

And then add the following code to the code snippet you created:

add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
  
$order = wc_get_order( $order_id );
$order->update_status( 'completed' );
}

And then try to make a test purchase and see if notification works as expected.

#2381405
custom code.png

Dear minesh,

I copied the code like an attachment to a Custom code snippets, activated it and tried it, but it didn't work.

Regards,

yoshihiko

#2382583

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Unfortunately Minesh is off sick today but should be back on Monday to continue assisting you with this one.

Thanks,
Shane

#2382615

Dear shane,

Thank you for contacting me.
I've understood the situation.
I'm looking forward to next week's support.

Thank you,

Yoshihiko

#2383765

Dear minesh,

Last time I set the code according to your support but it's not working.
Can you support me?

Thank you.

Yoshihihiko

#2384469

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

I was assigned to this ticket, and will take of it.

I have checked the post form setting of your screenshot:
https://toolset.com/wp-content/uploads/2022/06/2380977-post_form.png

It should be able to send the emails without custom codes.

Please check your email box spam folder?

If there isn't, please try to get PHP debug logs from your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging
section "PHP Debugging"

#2384509

Dear luo,

Thank you for contacting me.
I couldn't even find it in the spam folder of my mailbox.
Also, I can edit the wp-config.php file, but I don't know how to get the PHP debug logs next. Also, I can't understand it even if I look at the log.
I want to be able to send a thank you email somehow.

Regards,

Yoshihiko

#2385107

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Please provide a test site with the same problem, fill below private message box with the test site credentials + FTP/SFTP access, also point out the problem page URL and form URL, I need to debug it in a live website. thanks

#2385135

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I can login into your website, where can I see the problems?
Please point out the problem page URL(Where I can submit the post form in frontend) and the post form URL, thanks

#2385211

Dear Luo,

Problematic page # 1: hidden link

Problematic page # 2: Transition from page 1 (page to pay membership fee, post form is 5000yen) hidden link

This page has a 5000yen post form.
When the user fills in the required items on this form and posts, the thank-you page is set to reach the poster (user).
Please check the post form here (hidden link). You can see what I have set.

The most important part to check: Please check "e-mail notification". I haven't received the email addressed to [wpv-post-title] described in the notification e-mail body. I want to receive this email.

Regards,

Yoshihihiko