test the plugin : qa-category-email-notifications-event.php
you have the sql request on line 55 ; it's not so hard to add conditions if you want to restrict it to experts.
ie , replace
return array(
'columns' => array('^users.email'),
'source' => "^users JOIN ^userfavorites ON ^userfavorites.userid=^users.userid WHERE ^userfavorites.entityid=$ AND ^userfavorites.entitytype=$",
'arguments' => array($categoryid, QA_ENTITY_CATEGORY),
'sortasc' => 'title',
);
by
return array(
'columns' => array('^users.email'),
'source' => "^users JOIN ^userfavorites ON ^userfavorites.userid=^users.userid ".
" inner join ^userlevels on ^userlevels.userid=^users.userid".
" WHERE ^userfavorites.entityid=$ AND ^userfavorites.entitytype=$".
" and ^userlevels.entityid=$ and ^userlevels.entitytype=$ and ^userlevels.level>=$" ,
'arguments' => array($categoryid, QA_ENTITY_CATEGORY,$categoryid, QA_ENTITY_CATEGORY,QA_USER_LEVEL_EXPERT),
'sortasc' => 'title',
);
** the request can be optimized but it is the minimal modification to get the result
** if you need experts only, change "^userlevels.level>=$" by "^userlevels.level=$"