WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 11 months ago

#45359 new enhancement

Add checkbox to enable or disable sending out emails on password changes from backend

Reported by: atz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.8
Component: Users Keywords:
Focuses: Cc:
PR Number:

Description

Could we please add a checkbox on the user backend, that will toggle the sending of emails when something is changed in the backend, eg. and most important, the password?

It is a huge mistake trigger when developing sites or debugging staging/live sites with users or customers.

A little checkbox below the password field to stop WP from sending out a notification would be so great!

Change History (1)

#1 @BjornW
11 months ago

Hi @atz,

I (maybe wrongfully) assume WordPress will not add a setting to enable/disable sending out emails, but I do have a possible solution to share which I often use myself.

A possible solution while developing or debugging is using PHP's send_mail option in the PHP.ini. You can set it to use a shell script which can concatenate the outgoing mails into a logfile instead of sending them for real.

Assuming you are using linux here's how to do this: ($ = your terminal prompt)

  • open a terminal
  • $ echo "cat >> /tmp/emails-sent.log" > /usr/local/bin/logmail
  • $ chmod +x /usr/local/bin/logmail
  • In your php.ini set: sendmail_path=/usr/local/bin/logmail

Depending on your PHP and webserver settings you need to reload / restart them to make sure the sendmail_path has been updated correctly.

This will concatenate all emails into one file found in /tmp and called emails-sent.log which can be tailed with the command-line application tail. Hope this helps.


Note: See TracTickets for help on using tickets.