joeguilmette / wp-local-toolbox

A simple plugin to set different defaults for local, staging and production servers.
GNU General Public License v3.0
78 stars 13 forks source link

Redirect Email to Admin when not on Production #18

Open noameppel opened 8 years ago

joeguilmette commented 8 years ago

this is awesome.

do you think it'd be a good idea to make this optional and enabled with a global instead of on for everything except production?

cc: @jb510

jb510 commented 8 years ago

Yeah, I like the idea. Definitely needs to be optional though as there are many times we need email to work on staging to test things.

The other concern is the possibility of spam flooding one's self. We have sites that'll send out 1000's of membership emails, it might make more sense to have 3 options: 1) normal wp_mail 2) redirect wp_mail to admin 3) drop all mail

noameppel commented 8 years ago

Hello,

Glad you like. Hat tip to the Redirect Emails on Staging plugin (which only works on WPEngine) by @jpry.

Proposing a new WPLT_REDIRECT_EMAIL constant:

// This will redirect all email to the address specified: define( 'WPLT_REDIRECT_EMAIL', 'email@email.com' );

// Alternatively, this will prevent all mail from sending. define( 'WPLT_REDIRECT_EMAIL', 'DROP' );

For greatest flexibility, this would be allowed in any environment.

This should address the above concerns I believe? If so, I will submit a patch.

joeguilmette commented 8 years ago

Yes, that sounds great.

I moved some stuff around in 1.3.0 so that everything is now optional.