Showing empty account pages and sending welcome email

Please try this PHP snippet but please note that it can require further customization. If you are not familiar with the code customization then please consider hiring someone for custom work https://fvrr.co/32e7LvY

add_action(
	'hivepress/v1/models/user/register',
	function($user_id, $values){
		$admin_email = get_option('admin_email');
		
		if(!$admin_email){
			return;
		}
		
		$user = \HivePress\Models\User::query()->filter(['email' => $admin_email])->get_first();
		
		if(!$user){
			return;
		}
		
		( new \HivePress\Models\Message() )->fill(
			[
				'sender'               => $user->get_id(),
				'sender__display_name' => $user->get_display_name(),
				'sender__email'        => $user->get_email(),
				'recipient'            => $user_id,
				'read'                 => 0,
				'text' => 'Your custom text',
			]
		)->save();
	},
	1000,
	2
);
1 Like