For developers, the Slack Integration Add On offers one action hook that runs after each notification is sent to Slack. Use it to log the response from Slack or react when a message fails to send.

Actions

pmprosla_sent

Fires after the Add On sends a notification to your Slack webhook, for every event (checkout, expiration, and cancellation). It runs whether or not the request succeeded.

do_action( 'pmprosla_sent', array|WP_Error $response );

Parameters

  • $response: array|WP_Error; The response returned by wp_remote_post() for the request to the Slack webhook, or a WP_Error if the request failed.

Example

function my_pmprosla_log_failed_messages( $response ) {
	// Log any Slack notification that failed to send.
	if ( is_wp_error( $response ) ) {
		error_log( 'Slack notification failed: ' . $response->get_error_message() );
	} elseif ( 200 !== wp_remote_retrieve_response_code( $response ) ) {
		error_log( 'Slack notification failed: ' . wp_remote_retrieve_body( $response ) );
	}
}
add_action( 'pmprosla_sent', 'my_pmprosla_log_failed_messages' );

Last updated on November 19, 2026


Was this article helpful?
YesNo