diff --git a/rest-api/provisioner_rest_api_extensions.php b/rest-api/provisioner_rest_api_extensions.php index c8255c5..3680ddd 100644 --- a/rest-api/provisioner_rest_api_extensions.php +++ b/rest-api/provisioner_rest_api_extensions.php @@ -19,14 +19,17 @@ function federated_update_provision_status_failed_subscriptions($request){ $subscription_id = $request['subscription_id']; $error_message = $request['error_message']; - $subscription = wcs_get_subscription($subscription_id); update_field('provision_status', 'provision_failed', $subscription_id); update_field('error_message', $error_message, $subscription_id); - $output = array(); + $email_message = 'Provision failed for subscription #: ' . $subscription_id . '. Error message: ' . $error_message; + wp_mail('support@federated.computer', 'ALERT: Provision Failed', $email_message); + + $output = array(); $output['message'] = 'Marked as failed'; $output['success'] = true; + return $output; }