{"id":142304,"date":"2021-06-10T20:46:33","date_gmt":"2021-06-10T20:46:33","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/mailroad-switch\/"},"modified":"2021-06-10T20:46:14","modified_gmt":"2021-06-10T20:46:14","slug":"mailroad-switch","status":"publish","type":"plugin","link":"https:\/\/pap-aw.wordpress.org\/plugins\/mailroad-switch\/","author":18731079,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0","stable_tag":"1.0","tested":"5.7.15","requires":"5.2","requires_php":"7.4","requires_plugins":"","header_name":"Mailroad Switch","header_author":"MARSWorks Inc.","header_description":"Automated admin email rerouting. This plugin allows you to set separate admin email recipients for certain actions such as New User Registration or Fatal Errors.","assets_banners_color":"959394","last_updated":"2021-06-10 20:46:14","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/marsworks.com","rating":0,"author_block_rating":0,"active_installs":10,"downloads":972,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"marsworks","date":"2021-06-10 20:46:14"}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2545859,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2545859,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":2545859,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2545859,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2545859,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":2545859,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"New admin email options"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[83,267,2483,200295,24195],"plugin_category":[41],"plugin_contributors":[200296],"plugin_business_model":[],"class_list":["post-142304","plugin","type-plugin","status-publish","hentry","plugin_tags-admin","plugin_tags-email","plugin_tags-emails","plugin_tags-rerouting","plugin_tags-separate","plugin_category-communication","plugin_contributors-marsworks","plugin_committers-marsworks"],"banners":{"banner":"https:\/\/ps.w.org\/mailroad-switch\/assets\/banner-772x250.png?rev=2545859","banner_2x":"https:\/\/ps.w.org\/mailroad-switch\/assets\/banner-1544x500.png?rev=2545859","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/mailroad-switch\/assets\/icon.svg?rev=2545859","icon":"https:\/\/ps.w.org\/mailroad-switch\/assets\/icon.svg?rev=2545859","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/mailroad-switch\/assets\/screenshot-1.jpg?rev=2545859","caption":"New admin email options"}],"raw_content":"<!--section=description-->\n<p>This plugin allows you to set multiple admin email addresses. This means that you can finally send all of those New User emails to go to HR, and send those WP Error and Automatic Update emails to IT.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>mailroad-switch.zip<\/code> through the 'Add Plugins' screen in WordPress.<\/li>\n<li>Activate the plugin in WordPress.<\/li>\n<li>Navigate to Settings &gt; General to input your new email addresses.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='what%20plugins%20are%20supported%3F'><h3>What Plugins are Supported?<\/h3><\/dt>\n<dd><p>Currently, the only third-party plugin which is supported is 'Enable jQuery Migrate Helper'<\/p>\n\n<p>We did this because this plugin is used on many sites since the release of WordPress 5.2. Enable jQuery Migrate Helper comes with weekly emails along with emails regarding automatic downgrades of your site's jQuery version.<\/p>\n\n<p>You will be able to set an email recipient for the emails from Enable jQuery Migrate Helper. This option will only show if you have the Enable jQuery Migrate Helper plugin in your WordPress plugins directory.<\/p><\/dd>\n<dt id='how%20do%20i%20retrieve%20a%20value%20to%20use%20in%20my%20code%3F'><h3>How do I retrieve a value to use in my code?<\/h3><\/dt>\n<dd><p>You are able to use the static method <code>get_email_recipient<\/code><\/p>\n\n<pre><code>$address = \\Mailroad_Switch\\Includes\\Settings::get_email_recipient( 'errors' );\n<\/code><\/pre>\n\n<p>Default valid values passed to the method are:\n+ <code>updates<\/code>\n+ <code>errors<\/code>\n+ <code>users<\/code>\n+ <code>jquery_migrate<\/code><\/p>\n\n<p>If the email type does not exist or the option is not set for it, it will fallback to the admin email address you have set for your WordPress site.<\/p><\/dd>\n<dt id='i%20have%20a%20plugin%20that%20is%20sending%20me%20emails%2C%20but%20i%20do%20not%20see%20an%20option%20to%20change%20the%20email%20recipient.%20what%20do%20i%20do%3F'><h3>I have a plugin that is sending me emails, but I do not see an option to change the email recipient. What do I do?<\/h3><\/dt>\n<dd><p>You can open a question in the support forum to the right, and request that we add support for a third-party plugin.<\/p><\/dd>\n<dt id='i%20don%27t%20have%20time%20to%20wait%20for%20you%20to%20add%20support%20for%20more%20plugins%21%20i%20need%20to%20do%20it%20right%20now%21%20%2Afor%20developers%20only%2A'><h3>I don't have time to wait for you to add support for more plugins! I need to do it right now! *For Developers Only*<\/h3><\/dt>\n<dd><p>You are able to use the filter <code>mailroad_switch_available_hooks<\/code><\/p>\n\n<pre><code>add_filter( \"mailroad_switch_available_hooks\", function( $types ){\n   if( ! array_key_exists( \"my_unique_type\", $types ) ){\n      $types[\"my_unique_type\"] = [\n         \"label\" =&gt; \"My Unique Type\",\n         \"description\" =&gt; \"Emails coming from my custom plugin or theme\",\n         \"class\" =&gt; \"\\My\\Class\\Handler\"\n      ];\n   }\n   return $types;\n} );\n<\/code><\/pre>\n\n<p>The above code snippet will add a new admin setting below the other fields. The construct of your <code>\\My\\Class\\Handler<\/code> should have one parameter which will be the email address retrieved from the setting. You can then implement any WordPress or Plugin or Theme action and filter hooks in your class to change email recipients.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial launch of plugin<\/li>\n<li>Includes support for WordPress Core email notifications for User notices, WP Error notices, and Automatic Update notices.<\/li>\n<li>Includes support for Enable jQuery Migrate Helper plugin email notices.<\/li>\n<\/ul>","raw_excerpt":"Automated admin email rerouting. This plugin allows you to set separate admin email recipients for certain actions such as New User Registration or Fa &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/142304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=142304"}],"author":[{"embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/marsworks"}],"wp:attachment":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=142304"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=142304"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=142304"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=142304"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=142304"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=142304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}