Request: Add filter for manipulating arguments
-
Hi,
I would like to have the possibility to manipulate the arguments for send an e-mail. For this, in includes/wp-mail.php you could add the following just before sending the email (line #209 in plugin version 1.0.1):
$args = apply_filters( 'wp_sendgrid_args', $args );
This would enable me to disable the subscription tracking for a specific website that uses our company-wide SendGrid account by using the code below:
/** * Disables SendGrid subscription tracking */ function filter_wp_sendgrid_args( $args ) { $headers = array(); $headers['filters']['subscriptiontrack']['settings']['enable'] = 0; $args['x-smtpapi'] = json_encode($headers, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); return $args; } /** * Disable SendGrid subscription tracking */ add_filter( 'wp_sendgrid_args', 'filter_wp_sendgrid_args' );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Request: Add filter for manipulating arguments’ is closed to new replies.