mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 13:43:38 +09:00
- update account email notification;
This commit is contained in:
@@ -427,6 +427,19 @@ if ( ! class_exists( 'um\Config' ) ) {
|
||||
'recipient' => 'user',
|
||||
'default_active' => true
|
||||
),
|
||||
'changedaccount_email' => array(
|
||||
'key' => 'changedaccount_email',
|
||||
'title' => __( 'Account Updated Email','ultimate-member' ),
|
||||
'subject' => 'Your account at {site_name} was updated',
|
||||
'body' => 'Hi {display_name},<br /><br />' .
|
||||
'You recently updated your {site_name} account.<br /><br />' .
|
||||
'If you did not make this change and believe your {site_name} account has been compromised, please contact us at the following email address: {admin_email}<br /><br />' .
|
||||
'Thanks,<br />' .
|
||||
'{site_name}',
|
||||
'description' => __('Whether to send the user an email when he updated their account','ultimate-member'),
|
||||
'recipient' => 'user',
|
||||
'default_active'=> true
|
||||
),
|
||||
'notification_new_user' => array(
|
||||
'key' => 'notification_new_user',
|
||||
'title' => __( 'New User Notification','ultimate-member' ),
|
||||
|
||||
@@ -416,4 +416,29 @@ add_action( 'wp_footer', 'um_account_secure_registered_fields' );
|
||||
function um_after_user_account_updated_permalink( $user_id, $changed ) {
|
||||
UM()->user()->generate_profile_slug( $user_id );
|
||||
}
|
||||
add_action( 'um_after_user_account_updated', 'um_after_user_account_updated_permalink', 10, 2 );
|
||||
add_action( 'um_after_user_account_updated', 'um_after_user_account_updated_permalink', 10, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Update Account Email Notification
|
||||
*
|
||||
* @param $user_id
|
||||
* @param $changed
|
||||
*/
|
||||
function um_account_updated_notification( $user_id, $changed ) {
|
||||
um_fetch_user( $user_id );
|
||||
UM()->mail()->send( um_user( 'user_email' ), 'changedaccount_email' );
|
||||
}
|
||||
add_action( 'um_after_user_account_updated', 'um_account_updated_notification', 20, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Disable WP native email notification when change email on user account
|
||||
*
|
||||
* @param $user_id
|
||||
* @param $changed
|
||||
*/
|
||||
function um_disable_native_email_notificatiion( $changed, $user_id ) {
|
||||
add_filter( 'send_email_change_email', '__return_false' );
|
||||
}
|
||||
add_action( 'um_account_pre_update_profile', 'um_disable_native_email_notificatiion', 10, 2 );
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
?>
|
||||
|
||||
<div style="max-width: 560px;padding: 20px;background: #ffffff;border-radius: 5px;margin:40px auto;font-family: Open Sans,Helvetica,Arial;font-size: 15px;color: #666;">
|
||||
|
||||
<div style="color: #444444;font-weight: normal;">
|
||||
<div style="text-align: center;font-weight:600;font-size:26px;padding: 10px 0;border-bottom: solid 3px #eeeeee;">{site_name}</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
|
||||
<div style="padding: 0 30px 30px 30px;border-bottom: 3px solid #eeeeee;">
|
||||
|
||||
<div style="padding: 30px 0;font-size: 24px;text-align: center;line-height: 40px;">You recently updated your account.</div>
|
||||
|
||||
<div style="padding: 10px 0 50px 0;text-align: center;"><a href="{user_account_link}" style="background: #555555;color: #fff;padding: 12px 30px;text-decoration: none;border-radius: 3px;letter-spacing: 0.3px;">Go to your Account</a></div>
|
||||
|
||||
<div style="padding: 15px;background: #eee;border-radius: 3px;text-align: center;">If you did not make this change and believe your account has been compromised, please <a href="mailto:{admin_email}" style="color: #3ba1da;text-decoration: none;">contact us</a> ASAP.</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="color: #999;padding: 20px 30px">
|
||||
|
||||
<div style="">Thank you!</div>
|
||||
<div style="">The <a href="{site_url}" style="color: #3ba1da;text-decoration: none;">{site_name}</a> Team</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user