michaelryanmcneill / shibboleth

Shibboleth plugin for WordPress
https://wordpress.org/plugins/shibboleth/
19 stars 11 forks source link

Prevent Sending "Notice of Email Change" Emails #18

Closed jrchamp closed 6 years ago

jrchamp commented 6 years ago

Sometimes when I log into a WordPress installation with the Shibboleth plugin enabled, I receive one of these "Notice of Email Change" messages. I believe this is because the email address is being updated by shibboleth_update_user_data(); which is something that I fully expect if the field is being managed and has changed.

However, given that it is being managed and the update is triggered by the user, it seems unhelpful to then send them an, often confusing, email that is completely unrelated to their login authentication method (because they will log in externally through Shibboleth).

Thus, I believe it is appropriate for the Shibboleth plugin itself to deactivate the sending of the email change email. This could be easily accomplished by adding the following line to the beginning of the shibboleth_update_user_data() function:

add_filter( 'send_email_change_email', '__return_false' );

There may be a better place to add this, but this seems like the most direct, understandable location. If this plan is agreeable, I would be happy to create a pull request.

michaelryanmcneill commented 6 years ago

I like the idea, go ahead and submit a PR. Thanks @jrchamp! I should be getting around to releasing a new version of the plugin in a few weeks, things have just really picked up at work so my free time is limited right now.

jrchamp commented 6 years ago

PR against 1.9-alpha: #19