Hi,
Is there a way to send a report to a client when an update fails?
I’m looking for a way to inform clients when plugin or theme updates fails which seems to be when the client renew renew their subscriptions.
Or if there is another method that would work please let me know.
With a few lines of custom code it should be doable.
There is the do_action( 'mainwp_after_plugin_theme_translation_update', $information, $type, $list_items, $website ); hook in the system that you can use for this.
This hook fires after the update process and there are the parameters passed in it:
$infomation - returns info about processed updates
$type - returns if it was wp/plugin/theme/translation update
$list_items - returns the processed items
$website - returns the site info
so it would be something like
add_action( 'mainwp_after_plugin_theme_translation_update', 'your_custom_function_name' );
function your_custom_function_name() {
// Your code
}
Next in your custom method, you can parse the $information array to check for failed updates.
If there are any failed updates, you can use the wp_mail() function to send the email:
wp_mail($to, $subject, $message, $headers);
Subject, Message and Haeders you can set as per your preference, and the $to info you can set to Client email address which you can get from teh $website object.