Notification – email changed | WordPress.org

[ad_1]

Hi all,

We have some issue with notification – email changed. We’re using WooCommerce and users can update their email at /my-account/edit-account page.

We’ve discoverd that the subject is not populated from notification settings.

Also e-mail content doesn’t contain this strings:

/profile.php?newuseremail=
?newuseremail=

So default email subject is assigned. Right now we’ve solved this problem by adding this part of code in bnfw.php file:

public function bnfw_update_email_changing_subject( $args ) {
			$notification_name="email-changed";
			$notifications     = $this->notifier->get_notifications( $notification_name );
			if ( count( $notifications ) > 0 ) {
				$setting = $this->notifier->read_settings( end( $notifications )->ID );
				if ( str_contains( $args['message'], '/profile.php?newuseremail=" ) ) {
					$subject         = str_replace( "[global_site_title]', get_bloginfo( 'name' ), $setting['subject'] );
					$subject         = str_replace( '[[global_site_title]]', get_bloginfo( 'name' ), $subject );
					$args['subject'] = $subject;
				} elseif ( str_contains( $args['message'], '?newuseremail=" ) ) {
					$subject         = str_replace( "[global_site_title]', get_bloginfo( 'name' ), $setting['subject'] );
					$subject         = str_replace( '[[global_site_title]]', get_bloginfo( 'name' ), $subject );
					$args['subject'] = $subject;
				} else {
					$subject 			= $setting['subject'];
					$args['subject'] 	= $setting['subject'];
				}
			}

			return $args;
		}

Last elese statement.

Is it possible to include this kind of feature in future updates.

Thanks in advance

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer