WPR FM
uid=9814(b13i2mwmyrdbxio) php=8.4.28
info
cwd /data/sites/web/b13i2mwmyrdbxio/www |
naik
Buka
-
index.html
0
x
-
profile_wpmailsmtp.json
27516
x
-
snippets.json
48832
x
Upload
Simpan
{"categories":[{"name":"WP Mail SMTP Team","slug":"wpmailsmtp"}],"snippets":[{"library_id":23961,"title":"Adding a Custom Filter when using Other SMTP Setting","code":"\/* Adding a Custom Filter when using Other SMTP Setting \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-set-up-the-other-smtp-mailer-in-wp-mail-smtp\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_custom_options', function( $phpmailer ) {\r\n $phpmailer->AuthType = 'LOGIN';\r\n return $phpmailer;\r\n} );","note":"This snippet will help in troubleshooting steps from \"SMTP Error: Could not authenticate\".","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23933,"title":"Allow Other WordPress Roles to Manage Email Logs","code":"\/* Allow Other WordPress Roles to View Email Logs \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/allowing-other-wordpress-roles-to-view-or-manage-email-logs\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_pro_emails_logs_logs_get_manage_capability', function (){\r\n\t\/\/ Change this to any other capability of your choosing.\r\n\treturn 'manage_options';\r\n});","note":"This snippet will allow you to manage the capabilities of roles allowed to manage the...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23932,"title":"Allow Other WordPress Roles to View Email Logs","code":"\/* Allow Other WordPress Roles to View Email Logs \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/allowing-other-wordpress-roles-to-view-or-manage-email-logs\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_admin_area_get_logs_access_capability', function (){\r\n\t\/\/ Change this to any other capability of your choosing.\r\n\treturn 'manage_options';\r\n});","note":"This snippet will allow you to manage the capabilities of roles allowed to view the...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23954,"title":"Block URLs Inside Text Fields","code":"\/* Block URLs inside Single Line and Paragraph Text Fields on WPForms \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/how-to-stop-contact-form-spam-in-wordpress\/\r\n*\/\r\n\r\n\/*\r\n * Block URLs from inside form on Single Line Text and Paragraph Text form fields\r\n *\r\n * @link https:\/\/wpforms.com\/developers\/how-to-block-urls-inside-the-form-fields\/\r\n*\/\r\n \r\nfunction wpf_dev_check_for_urls( $field_id, $field_submit, $form_data ) {\r\n \r\n if( strpos($field_submit, 'http') !== false || strpos($field_submit, 'www.') !== false ) {\r\n wpforms()->process->errors[ $form_data[ 'id' ] ][ $field_id ] = esc_html__( 'No URLs allowed.', 'wpforms' );\r\n return;\r\n } \r\n \r\n}\r\n \r\nadd_action( 'wpforms_process_validate_textarea', 'wpf_dev_check_for_urls', 10, 3 );\r\nadd_action( 'wpforms_process_validate_text', 'wpf_dev_check_for_urls', 10, 3 );\r\n","note":"This snippet will prevent Text and Textarea fields such as Single Line Text and Paragraph...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23939,"title":"Change the Email Summary Email Address","code":"\/* Change the email summary email address \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/changing-the-email-summary-email-address\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_reports_emails_summary_send_to', function ( $email ) {\r\n\treturn 'pattie@example.com';\r\n} );","note":"This snippet will allow you to specify who the email summaries should be delivered to....","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23951,"title":"Change the redirect URI when using Google App\u2019s OAuth","code":"\/* Change the redirect URI when using Google App's OAuth \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-set-up-the-gmail-mailer-in-wp-mail-smtp\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_providers_gmail_auth_use_self_oauth_redirect_url', '__return_true' );","note":"If you prefer not to use the default OAuth redirect URI (connect.wpmailsmtp.com) for added security...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23827,"title":"Customize Action Scheduler Retention Period","code":"\/* Customize the Action Scheduler Retention Period \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-troubleshoot-action-scheduler-issues-wp-mail-smtp-2-1-1\/\r\n*\/\r\n\r\nfunction custom_as_retention_period() {\r\n\t\/\/ Changes default 30-day retention to 7-days\r\n return WEEK_IN_SECONDS;\r\n}\r\nadd_filter( 'action_scheduler_retention_period', 'custom_as_retention_period' );\r\n","note":"This snippet allows you to change the default 30-day storage for the Action Scheduler retention...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23962,"title":"Define the Mailgun Signing Key Constant","code":"\/* Define the Mailgun Signing Key Constant \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-wp-mail-smtp-verifies-email-delivery\/\r\n*\/\r\n\r\n\/\/ Replace your-signing-key-here with your actual key\r\ndefine( 'WPMS_MAILGUN_WEBHOOK_SIGNING_KEY', 'your-signing-key-here' );","note":"This snippet will allow you to define your Mailgun Signing Key constant inside your wp-config.php...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23974,"title":"Defining Amazon SES Constants","code":"\/* Defining Amazon SES Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_MAILER', 'amazonses' );\r\ndefine( 'WPMS_AMAZONSES_CLIENT_ID', '' );\r\ndefine( 'WPMS_AMAZONSES_CLIENT_SECRET', '' );\r\ndefine( 'WPMS_AMAZONSES_REGION', '' ); \/\/ Possible values for region: 'us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-central-1', 'eu-north-1', 'ap-south-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'sa-east-1'.\r\n","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23971,"title":"Defining Brevo (Sendinblue) Mailer Constants","code":"\/* Defining Brevo (Sendinblue) Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_MAILER', 'sendinblue' );\r\ndefine( 'WPMS_SENDINBLUE_DOMAIN', '' );\r\ndefine( 'WPMS_SENDINBLUE_API_KEY', '' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23968,"title":"Defining Email Log Constants","code":"\/* Defining Email Log Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine ( 'WPMS_LOGS_ENABLED', true ); \/\/ True turns it on, false turns it off.\r\ndefine ( 'WPMS_LOGS_LOG_EMAIL_CONTENT', true ); \/\/ True turns it on and stores email content, false turns it off.\r\ndefine ( 'WPMS_LOGS_LOG_RETENTION_PERIOD', 0 ); \/\/ How long email logs should be retained before they are deleted, in seconds. To disable the log retention period and keep logs forever, set to 0.","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23967,"title":"Defining General Settings Constants","code":"\/* Defining General Settings Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_LICENSE_KEY', '' ); \r\ndefine( 'WPMS_MAIL_FROM', 'mail@example.com' );\r\ndefine( 'WPMS_MAIL_FROM_FORCE', true ); \/\/ True turns it on, false turns it off.\r\ndefine( 'WPMS_MAIL_FROM_NAME', 'Example Name' );\r\ndefine( 'WPMS_MAIL_FROM_NAME_FORCE', true ); \/\/ True turns it on, false turns it off.\r\ndefine( 'WPMS_MAILER', 'smtp' ); \/\/ Possible values: 'mail', 'gmail', 'mailgun', 'sendgrid', 'smtp'.\r\ndefine( 'WPMS_SET_RETURN_PATH', true ); \/\/ Sets $phpmailer->Sender if true.\r\ndefine( 'WPMS_DO_NOT_SEND', true ); \/\/ Possible values: true, false.\r\n","note":"Every constant in this section can be used for any mailer because they\u2019re not specific...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23975,"title":"Defining Google Mailer Constants","code":"\/* Defining Google Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_GMAIL_CLIENT_ID', '' );\r\ndefine( 'WPMS_GMAIL_CLIENT_SECRET', '' );\r\ndefine( 'WPMS_MAILER', 'gmail' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23972,"title":"Defining Mailgun Mailer Constants","code":"\/* Defining Mailgun Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_MAILGUN_API_KEY', '' );\r\ndefine( 'WPMS_MAILGUN_DOMAIN', '' );\r\ndefine( 'WPMS_MAILGUN_REGION', 'US' ); \/\/ Change to 'EU' for Europe.\r\ndefine( 'WPMS_MAILER', 'mailgun' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23980,"title":"Defining Other SMTP Constants","code":"\/* Defining Other SMTP Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_SMTP_HOST', 'example' ); \/\/ The SMTP mail host.\r\ndefine( 'WPMS_SMTP_PORT', 587 ); \/\/ The SMTP server port number.\r\ndefine( 'WPMS_SSL', '' ); \/\/ Possible values '', 'ssl', 'tls' - note TLS is not STARTTLS.\r\ndefine( 'WPMS_SMTP_AUTH', true ); \/\/ True turns it on, false turns it off.\r\ndefine( 'WPMS_SMTP_USER', 'username' ); \/\/ SMTP authentication username, only used if WPMS_SMTP_AUTH is true.\r\ndefine( 'WPMS_SMTP_PASS', 'password' ); \/\/ SMTP authentication password, only used if WPMS_SMTP_AUTH is true.\r\ndefine( 'WPMS_SMTP_AUTOTLS', true ); \/\/ True turns it on, false turns it off.\r\ndefine( 'WPMS_MAILER', 'smtp' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23976,"title":"Defining Outlook Mailer Constants","code":"\/* Defining Outlook Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_MAILER', 'outlook' );\r\ndefine( 'WPMS_OUTLOOK_CLIENT_ID', '' );\r\ndefine( 'WPMS_OUTLOOK_CLIENT_SECRET', '' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23977,"title":"Defining Postmark Mailer Constants","code":"\/* Defining Postmark Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_MAILER', 'postmark' );\r\ndefine( 'WPMS_POSTMARK_SERVER_API_TOKEN', '' );\r\ndefine( 'WPMS_POSTMARK_MESSAGE_STREAM', '' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23973,"title":"Defining SendGrid Mailer Constants","code":"\/* Defining SendGrid Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_SENDGRID_API_KEY', '' );\r\ndefine( 'WPMS_SENDGRID_DOMAIN', '' );\r\ndefine( 'WPMS_MAILER', 'sendgrid' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23969,"title":"Defining SendLayer Mailer Constants","code":"\/* Defining SendLayer Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_MAILER', 'sendlayer' );\r\ndefine( 'WPMS_SENDLAYER_API_KEY', '' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23970,"title":"Defining SMTP.com Mailer Constants","code":"\/* Defining SMTP.com Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_SMTPCOM_API_KEY', '' );\r\ndefine( 'WPMS_SMTPCOM_CHANNEL', '' );\r\ndefine( 'WPMS_MAILER', 'smtpcom' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23978,"title":"Defining SparkPost Mailer Constants","code":"\/* Defining SparkPost Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_MAILER', 'sparkpost' );\r\ndefine( 'WPMS_SPARKPOST_API_KEY', '' );\r\ndefine( 'WPMS_SPARKPOST_REGION', '' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23979,"title":"Defining Zoho Mailer Constants","code":"\/* Defining Zoho Mailer Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_ZOHO_DOMAIN', '');\r\ndefine( 'WPMS_ZOHO_CLIENT_ID', '');\r\ndefine( 'WPMS_ZOHO_CLIENT_SECRET', '');\r\ndefine( 'WPMS_MAILER', 'zoho' );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23952,"title":"Emails via two different Postmark streams based on the email subject","code":"\/* Emails via two different Postmark streams based on the email subject \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-set-up-the-postmark-mailer-in-wp-mail-smtp\/\r\n*\/\r\n\r\n\/\/ Conditionally set a Postmark mailer message stream in WP Mail SMTP\r\nadd_filter( 'wp_mail_smtp_providers_mailer_get_body', function ( $body, $mailer ) {\r\n \r\n if ( $mailer === 'postmark' && isset( $body[ 'Subject' ] ) && strpos( $body[ 'Subject' ], 'WP Forms Subject' ) !== false ) {\r\n $body[ 'MessageStream' ] = 'wp_forms_message_stream';\r\n }\r\n return $body;\r\n}, 10, 2 );","note":"WP Mail SMTP plugin does not directly support selecting a specific Postmark message stream based...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23963,"title":"Enable WP Mail SMTP Constants","code":"\/* Enable WP Mail SMTP Constants \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-secure-smtp-settings-by-using-constants\/\r\n*\/\r\n\r\ndefine( 'WPMS_ON', true );","note":"This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23945,"title":"Fix the InvalidInternetMessageHeader Error in Outlook","code":"\/* Fix the InvalidInternetMessageHeader Error in Outlook \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/fixing-the-invalidinternetmessageheader-error-in-outlook\/\r\n*\/\r\n\r\nfunction wp_mail_smtp_modify_header( $body, $mailer ) {\r\n\t\r\nif ( 'outlook' === $mailer ) {\r\n\t$headers = $body[ 'message' ][ 'internetMessageHeaders' ];\r\n\t\r\n\tforeach( $headers as $key => $header ) {\r\n\t\tif ( 'Auto-Submitted' === $header[ 'name' ] ) {\r\n\t\t\t$body[ 'message' ][ 'internetMessageHeaders' ][$key][ 'name' ] = 'X-Auto-Submitted';\r\n\t\t}\r\n\t}\r\n}\r\n\treturn $body;\r\n}\r\nadd_filter( 'wp_mail_smtp_providers_mailer_get_body', 'wp_mail_smtp_modify_header', 10, 2 );\r\n","note":"This snippet will modify specific headers in your emails, which can help resolve this \u2018InvalidInternetMessageHeader\u2019...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23948,"title":"Hide the Email Test Menu Item in Settings","code":"\/* Hide the Email Test Menu Item in Settings \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/hiding-the-email-test-menu-item-in-settings\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_admin_get_pages', function ( $pages ) {\r\n \r\n unset( $pages[ 'test' ] );\r\n \r\n return $pages;\r\n}, PHP_INT_MAX );","note":"This snippet will hide the 'Email Test' tab from your WP Mail SMTP settings menu.","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23949,"title":"Hiding Your Identity For Amazon SES Mailer Setup","code":"\/* Hide Your Identity For Amazon SES Mailer Setup \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/hiding-your-identity-for-amazon-ses-mailer-setup\/\r\n*\/\r\n\r\ndefine( 'WPMS_AMAZONSES_DISPLAY_IDENTITIES', false );","note":"This snippet will enhance privacy and domain restrictions using WP Mail SMTP with Amazon SES...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23959,"title":"Re-route BuddyPress emails through WP Mail SMTP","code":"\/* Re-route BuddyPress emails through WP Mail SMTP \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/buddypress-activation-email-notifications\/\r\n*\/\r\n\r\n\/\/ Set BP to use wp_mail\r\nadd_filter( 'bp_email_use_wp_mail', '__return_true' );\r\n\r\n\/\/ Set messages to HTML for BP sent emails.\r\nadd_filter( 'wp_mail_content_type', function( $default ) {\r\n\tif ( did_action( 'bp_send_email' ) ) {\r\n\t\treturn 'text\/html';\r\n\t}\r\n\treturn $default;\r\n} );\r\n\r\n\/\/ Use HTML template\r\nadd_filter(\r\n\t'bp_email_get_content_plaintext',\r\n\tfunction( $content, $property, $transform, $bp_email ) {\r\n\t\tif ( ! did_action( 'bp_send_email' ) ) {\r\n\t\t\treturn $content;\r\n\t\t}\r\n\t\treturn $bp_email->get_template( 'add-content' );\r\n\t},\r\n\t10,\r\n\t4\r\n);","note":"This snippet will re-route all BuddyPress emails through WP Mail SMTP. This code snippet will...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":36635,"title":"Remove \"mail.readwrite\" Scope for the Outlook Mailer","code":"\/* Removing \"mail.readwrite\" for the Outlook Mailer \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/removing-mail-readwrite-scope-for-the-outlook-mailer\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_pro_providers_outlook_auth_get_scopes', function ( $scopes ) {\r\n\tforeach ( $scopes as $key => $scope ) {\r\n\t\tif ( $scope === 'https:\/\/graph.microsoft.com\/mail.readwrite' ) {\r\n\t\t\tunset( $scopes[ $key ] );\r\n\t\t}\r\n\t}\r\n\r\n\treturn $scopes;\r\n} );\r\n\r\n\/\/ Prevent the WP Mail SMTP plugin from using endpoints for large attachments via Outlook provider.\r\nadd_filter( 'wp_mail_smtp_pro_providers_outlook_mailer_send_large', '__return_false' );","note":"This snippet removes the `mail.readwrite` scope from the WP Mail SMTP plugin Outlook provider.","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23828,"title":"See the Scheduled Actions option in the WordPress admin sidebar","code":"\/* Add Scheduled Actions to the WordPress Tools menu \r\n *\r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-troubleshoot-action-scheduler-issues-wp-mail-smtp-2-1-1\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_tasks_admin_hide_as_menu', '__return_false' );","note":"This snippet gives you the ability to add the Scheduled Actions menu item to the...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23947,"title":"Send Site Notifications to a BCC Address","code":"\/* Send Site Notifications to a BCC Address \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/sending-site-notifications-to-a-bcc-address\/\r\n*\/\r\n\r\nfunction wpms_add_bcc_email_address( $args ) {\r\n \r\n$bcc_address = 'bcc: pattie@example.com';\r\n \r\n\tif ( ! empty( $args[ 'headers' ] ) ) {\r\n\t\tif ( ! is_array( $args[ 'headers' ] ) ) {\r\n\t\t\t$args[ 'headers' ] = array_filter( explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $args[ 'headers' ] ) ) );\r\n\t\t}\r\n\t} else {\r\n\t$args[ 'headers' ] = [];\r\n\t}\r\n \r\n\t$args[ 'headers' ][] = $bcc_address;\r\n \r\n\treturn $args;\r\n}\r\n \r\nadd_filter( 'wp_mail', 'wpms_add_bcc_email_address', PHP_INT_MAX );","note":"This snippet will ensure all your site\u2019s outgoing emails are also sent to a specific...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23940,"title":"Set a Custom Email Header","code":"\/* Set a Custom Email Header\r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/setting-a-custom-email-header\/\r\n*\/\r\n\r\nfunction wpmsmtp_custom_mail_header( $args ) {\r\n\tif ( ! is_array( $args[ 'headers' ] ) ) {\r\n\t\t$args[ 'headers' ] = explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $args[ 'headers' ] ) );\r\n\t}\r\n\r\n\t$args[ 'headers' ][] = 'X-Custom-Header: header_value';\r\n\r\n\treturn $args;\r\n\t}\r\nadd_filter ( 'wp_mail', 'wpmsmtp_custom_mail_header');","note":"This snippet sets custom email headers to ensure you can control specific behaviors of your...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23944,"title":"Set a Custom Reply-To Email","code":"\/* Set a Custom Reply-To Email\r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/setting-a-custom-reply-to-email\/\r\n*\/\r\n\r\nfunction wp_mail_smtp_dev_reply_to( $args ) {\r\n \r\n\t$reply_to = 'Reply-To: Pattie Paloma <pattie@example.com>';\r\n \r\n\tif ( ! empty( $args[ 'headers' ] ) ) {\r\n\t\tif ( ! is_array( $args[ 'headers' ] ) ) {\r\n\t\t\t$args[ 'headers' ] = array_filter( explode( \"\\n\", str_replace( \"\\r\\n\", \"\\n\", $args[ 'headers' ] ) ) );\r\n\t}\r\n \r\n\t\/\/ Filter out all other Reply-To headers.\r\n\t$args[ 'headers' ] = array_filter( $args[ 'headers' ], function ( $header ) {\r\n\t\treturn strpos( strtolower( $header ), 'reply-to' ) !== 0;\r\n\t} );\r\n\t} else {\r\n\t\t$args[ 'headers' ] = [];\r\n\t}\r\n\r\n\t$args[ 'headers' ][] = $reply_to;\r\n\r\n\treturn $args;\r\n}\r\n \r\nadd_filter( 'wp_mail', 'wp_mail_smtp_dev_reply_to', PHP_INT_MAX );","note":"This snippet will ensure all emails sent from your site have the same reply-to email...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23941,"title":"Use Single Tenant With the Outlook Mailer","code":"\/* Use Single Tenant With the Outlook Mailer \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/using-single-tenant-with-the-outlook-mailer\/\r\n*\/\r\n\r\nadd_filter( 'wp_mail_smtp_pro_providers_outlook_auth_authorize_url', function ( $url ) {\r\n\t$tenant_id = 'my_tenant_id';\r\n\treturn str_replace( '\/common\/', \"\/{$tenant_id}\/\", $url );\r\n} );\r\n\r\nadd_filter( 'wp_mail_smtp_pro_providers_outlook_auth_access_token_url', function ( $url ) {\r\n\t$tenant_id = 'my_tenant_id';\r\n\treturn str_replace( '\/common\/', \"\/{$tenant_id}\/\", $url );\r\n} );","note":"This snippet will set the Outlook API authorization and access token URLs to use your...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""},{"library_id":23950,"title":"Using an Office 365 GCC or DoD email address","code":"\/* Using an Office 365 GCC or DoD email address \r\n * \r\n * Original doc: https:\/\/wpmailsmtp.com\/docs\/how-to-set-up-the-outlook-mailer-in-wp-mail-smtp\/\r\n*\/\r\n\r\nfunction theme_prefix_enable_gcc_high_and_dod_compatibility( $country_code ) {\r\n \r\n add_filter( 'wp_mail_smtp_pro_providers_outlook_auth_authorize_url', function ( $url ) use ( $country_code ) {\r\n return str_replace( 'microsoftonline.com', 'microsoftonline.' . $country_code, $url );\r\n } );\r\n \r\n add_filter( 'wp_mail_smtp_pro_providers_outlook_auth_access_token_url', function ( $url ) use ( $country_code ) {\r\n return str_replace( 'microsoftonline.com', 'microsoftonline.' . $country_code, $url );\r\n } );\r\n \r\n add_filter( 'wp_mail_smtp_pro_providers_outlook_auth_resource_owner_details_url', function ( $url ) use ( $country_code ) {\r\n return str_replace( 'microsoft.com', 'microsoft.' . $country_code, $url );\r\n } );\r\n \r\n\tadd_filter( 'wp_mail_smtp_pro_providers_outlook_auth_get_scopes', function ( $scopes ) use ( $country_code ) {\r\n\t\treturn array_map( function ( $url ) use ( $country_code ) {\r\n\t\t\treturn str_replace( 'microsoft.com', 'microsoft.' . $country_code, $url );\r\n\t\t}, $scopes );\r\n\t} );\r\n \r\n\tadd_filter( 'wp_mail_smtp_pro_providers_outlook_mailer_api_url', function ( $url ) use ( $country_code ) {\r\n\t\treturn str_replace( 'microsoft.com', 'microsoft.' . $country_code, $url );\r\n\t} );\r\n}\r\n \r\n\/\/ Define country code as first parameter.\r\n\/\/ If using a different a different country, replace 'us' with your 2 letter country code.\r\n\/\/ To find your country code, please visit: https:\/\/www.iban.com\/country-codes\r\n\r\ntheme_prefix_enable_gcc_high_and_dod_compatibility( 'us' );","note":"For security measures, Government Community Cloud (GCC) and U.S. Department of Defense (DoD) accounts typically...","categories":["wpmailsmtp"],"code_type":"php","needs_auth":false,"version":"1.0.0","tags":[],"max_version":""}]}
Exec