wp-local-toolbox icon indicating copy to clipboard operation
wp-local-toolbox copied to clipboard

Redirect Email to Admin when not on Production

Open noameppel opened this issue 9 years ago • 4 comments

noameppel avatar Feb 17 '16 12:02 noameppel

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

joeguilmette avatar Feb 18 '16 07:02 joeguilmette

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

jb510 avatar Feb 18 '16 07:02 jb510

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 protected]' );

// 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.

noameppel avatar Feb 18 '16 08:02 noameppel

Yes, that sounds great.

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

joeguilmette avatar Apr 28 '16 16:04 joeguilmette