Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add disable notification about admin email changed #454

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo
* [Changed] Minimum required PHP version from 7.4.
* [Changed] WordPress Coding Standards to PSR-12 standards.
* [Added] New trigger after user confirms his new email address
* [Added] Disable notification about admin email address changed
jakubmikita marked this conversation as resolved.
Show resolved Hide resolved

**Compatibility Breaking Changes**

Expand Down
16 changes: 16 additions & 0 deletions src/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,22 @@ public function emailsSettings($settings)
'sanitize' => [new CoreFields\Checkbox(), 'sanitize'],
]
)
->addField(
[
'name' => __('Admin Email address changed', 'notification'),
'slug' => 'send_confirmation_on_admin_email_changed',
'default' => false,
'addons' => [
'label' => __(
'Disable email to <strong>new admin</strong> about site email address changed.',
'notification'
),
],
'description' => __('Email is sent when new site email address is confirmed.', 'notification'),
'render' => [new CoreFields\Checkbox(), 'input'],
'sanitize' => [new CoreFields\Checkbox(), 'sanitize'],
]
)
->addField(
[
'name' => __('Automatic WordPress core update', 'notification'),
Expand Down
13 changes: 13 additions & 0 deletions src/Integration/WordPressEmails.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,19 @@ public function disableSendConfirmationOnAdminEmail()
);
}

/**
* Disables email on admin email address changed
*
* @filter send_site_admin_email_change_email
*
* @since [Next]
* @return bool
*/
public function disableSendConfirmationOnAdminEmailChanged()
{
return getSetting('integration/emails/send_confirmation_on_admin_email_changed') !== 'true';
}

/**
* Disables send the email change email to user
*
Expand Down
Loading