/* 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
/* Change the email summary email address * * Original doc: https://wpmailsmtp.com/docs/changing-the-email-summary-email-address/ */ add_filter( ‘wp_mail_smtp_reports_emails_summary_send_to’, function ( $email ) { return ‘[email protected]’; } );Continue reading
/* Allow Other WordPress Roles to View Email Logs * * Original doc: https://wpmailsmtp.com/docs/allowing-other-wordpress-roles-to-view-or-manage-email-logs/ */ add_filter( ‘wp_mail_smtp_pro_emails_logs_logs_get_manage_capability’, function (){ // Change this to any other capability of your choosing. return ‘manage_options’; });Continue reading
/* Allow Other WordPress Roles to View Email Logs * * Original doc: https://wpmailsmtp.com/docs/allowing-other-wordpress-roles-to-view-or-manage-email-logs/ */ add_filter( ‘wp_mail_smtp_admin_area_get_logs_access_capability’, function (){ // Change this to any other capability of your choosing. return ‘manage_options’; });Continue reading
add_action( ‘init’, function() { if ( ! current_user_can( ‘manage_options’ ) && ! is_admin() && ! is_login() ) { wp_die( ‘This website is currently undergoing scheduled maintenance. Please try again later.’ ); } } );Continue reading
add_filter( ‘wp_handle_upload’, function ( $file ) { $max_width = 1920; $max_height = 1920; // Check if the file is an image. $mime_type = mime_content_type( $file[‘file’] ); if ( strpos( $mime_type, ‘image’ ) === false ) { return $file; } //…Continue reading