Notify ONLY Verified Vendors about new Requests

Hello, for website owners that sell some premium package for vendors, or want to add an icnentive for some action, like verify profile, it would be awesome if we had the option to notify ONLY verified vendors about new requests.

It would generate more sales of premium packages because vendors would have an incentive to update their profile.

Bellow is the request configuration page, something like this as an option over there. Thanks!

Hi,
I highly recommend using Search Alerts Search Alerts - Notify users about new listings | HivePress Extensions so vendors will be able to get notifications for specific request categories or search criteria, but if you mean making this change for the built-in notification option, you can try this code snippet:

add_filter(
	'hivepress/v1/emails/request_find',
	function ($args, $email){
		$user = hivepress()->helper->search_array_value($args, 'user');
		
		if(!$user){
			return $args;
		}
		
		$vendor = HivePress\Models\Vendor::query()->filter(['user' => $user->get_id()])->get_first();
		
		if(!$vendor || !$vendor->is_verified()){
			$args['body'] = '';
		}
		
		return $args;
	},
	1000,
	2
);
1 Like

@yevhen thank you :slightly_smiling_face:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.