Last active
November 29, 2018 16:50
-
-
Save jrick1229/8564ddff519d420869c75899a9190f05 to your computer and use it in GitHub Desktop.
Email customer immediately upon first failed payment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function wcs_my_custom_retry_rules( $default_retry_rules_array ) { | |
return array( | |
array( | |
'retry_after_interval' => DAY_IN_SECONDS / 2, // how long to wait before retrying | |
'email_template_customer' => 'WCS_Email_Customer_Payment_Retry', // email customer immediately upon first failed payment | |
'email_template_admin' => 'WCS_Email_Payment_Retry', | |
'status_to_apply_to_order' => 'pending', | |
'status_to_apply_to_subscription' => 'on-hold', | |
), | |
array( | |
'retry_after_interval' => DAY_IN_SECONDS / 2, | |
'email_template_customer' => 'WCS_Email_Customer_Payment_Retry', | |
'email_template_admin' => 'WCS_Email_Payment_Retry', | |
'status_to_apply_to_order' => 'pending', | |
'status_to_apply_to_subscription' => 'on-hold', | |
), | |
array( | |
'retry_after_interval' => DAY_IN_SECONDS, | |
'email_template_customer' => 'WCS_Email_Customer_Payment_Retry', | |
'email_template_admin' => 'WCS_Email_Payment_Retry', | |
'status_to_apply_to_order' => 'pending', | |
'status_to_apply_to_subscription' => 'on-hold', | |
), | |
array( | |
'retry_after_interval' => DAY_IN_SECONDS * 2, | |
'email_template_customer' => 'WCS_Email_Customer_Payment_Retry', | |
'email_template_admin' => 'WCS_Email_Payment_Retry', | |
'status_to_apply_to_order' => 'pending', | |
'status_to_apply_to_subscription' => 'on-hold', | |
), | |
array( | |
'retry_after_interval' => DAY_IN_SECONDS * 3, | |
'email_template_customer' => 'WCS_Email_Customer_Payment_Retry', | |
'email_template_admin' => 'WCS_Email_Payment_Retry', | |
'status_to_apply_to_order' => 'pending', | |
'status_to_apply_to_subscription' => 'on-hold', | |
), | |
); | |
} | |
add_filter( 'wcs_default_retry_rules', 'wcs_my_custom_retry_rules' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment