/* Emails via two different Postmark streams based on the email subject * * Original doc: https://wpmailsmtp.com/docs/how-to-set-up-the-postmark-mailer-in-wp-mail-smtp/ */ // Conditionally set a Postmark mailer message stream in WP Mail SMTP add_filter( ‘wp_mail_smtp_providers_mailer_get_body’, function ( $body, $mailer ) { if (…Continue reading
/* Change the redirect URI when using Google App’s OAuth * * Original doc: https://wpmailsmtp.com/docs/how-to-set-up-the-gmail-mailer-in-wp-mail-smtp/ */ add_filter( ‘wp_mail_smtp_providers_gmail_auth_use_self_oauth_redirect_url’, ‘__return_true’ );Continue reading
/* Using an Office 365 GCC or DoD email address * * Original doc: https://wpmailsmtp.com/docs/how-to-set-up-the-outlook-mailer-in-wp-mail-smtp/ */ function theme_prefix_enable_gcc_high_and_dod_compatibility( $country_code ) { add_filter( ‘wp_mail_smtp_pro_providers_outlook_auth_authorize_url’, function ( $url ) use ( $country_code ) { return str_replace( ‘microsoftonline.com’, ‘microsoftonline.’ . $country_code, $url );…Continue reading
/* Hide Your Identity For Amazon SES Mailer Setup * * Original doc: https://wpmailsmtp.com/docs/hiding-your-identity-for-amazon-ses-mailer-setup/ */ define( ‘WPMS_AMAZONSES_DISPLAY_IDENTITIES’, false );Continue reading
/* Hide the Email Test Menu Item in Settings * * Original doc: https://wpmailsmtp.com/docs/hiding-the-email-test-menu-item-in-settings/ */ add_filter( ‘wp_mail_smtp_admin_get_pages’, function ( $pages ) { unset( $pages[ ‘test’ ] ); return $pages; }, PHP_INT_MAX );Continue reading
/* Send Site Notifications to a BCC Address * * Original doc: https://wpmailsmtp.com/docs/sending-site-notifications-to-a-bcc-address/ */ function wpms_add_bcc_email_address( $args ) { $bcc_address = ‘bcc: [email protected]’; if ( ! empty( $args[ ‘headers’ ] ) ) { if ( ! is_array( $args[ ‘headers’ ]…Continue reading
/* Fix the InvalidInternetMessageHeader Error in Outlook * * Original doc: https://wpmailsmtp.com/docs/fixing-the-invalidinternetmessageheader-error-in-outlook/ */ function wp_mail_smtp_modify_header( $body, $mailer ) { if ( ‘outlook’ === $mailer ) { $headers = $body[ ‘message’ ][ ‘internetMessageHeaders’ ]; foreach( $headers as $key => $header )…Continue reading
/* Set a Custom Reply-To Email * * Original doc: https://wpmailsmtp.com/docs/setting-a-custom-reply-to-email/ */ function wp_mail_smtp_dev_reply_to( $args ) { $reply_to = ‘Reply-To: Pattie Paloma ‘; if ( ! empty( $args[ ‘headers’ ] ) ) { if ( ! is_array( $args[ ‘headers’ ]…Continue reading
/* Use Single Tenant With the Outlook Mailer * * Original doc: https://wpmailsmtp.com/docs/using-single-tenant-with-the-outlook-mailer/ */ add_filter( ‘wp_mail_smtp_pro_providers_outlook_auth_authorize_url’, function ( $url ) { $tenant_id = ‘my_tenant_id’; return str_replace( ‘/common/’, “/{$tenant_id}/”, $url ); } ); add_filter( ‘wp_mail_smtp_pro_providers_outlook_auth_access_token_url’, function ( $url ) { $tenant_id…Continue reading
/* Set a Custom Email Header * * Original doc: https://wpmailsmtp.com/docs/setting-a-custom-email-header/ */ function wpmsmtp_custom_mail_header( $args ) { if ( ! is_array( $args[ ‘headers’ ] ) ) { $args[ ‘headers’ ] = explode( “\n”, str_replace( “\r\n”, “\n”, $args[ ‘headers’ ] )…Continue reading