This question has been answered by BobRay. See the first response.
I think that would best be done in a plugin attached to OnDocFormSave. At that point, you can tell the difference between new and existing documents, so the plugin could fire off the email if a new resource is being saved by a member of the Editors user group.
There may already be an extra that does this. If not, it should be relatively simple to create.
That should be easy enough to do with a checkbox TV ("Submit for Review"). The hook for ResourceWatcher could check the TV value and the user group of the creator.
/** * * * A hook to send approval request. Only triggered upon resource update */
$usergroup='Editor';
$resource = $modx->getObject('modResource', $scriptProperties['id']);
$editor = $resource->get('editedby');
$user=$modx->getObject('modUser',array('id'=>$editor));
$checkMembership = $user->isMember($usergroup);
$state = $resource->getTVValue('approvalSwitch');
if ($state=='yes' && $checkMembership==true) {
// resource is not from editor, we don't want notifications
return true; }
return false;
<?php
/** * * * A hook to send approval request. Only triggered upon resource update */
$usergroup='Editor';
if (! isset($scriptProperties['id'])) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'scriptProperties ID not set');
return;
}
$resource = $modx->getObject('modResource', $scriptProperties['id']);
if (! $resource) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'Could not get Resource. ID: ' . $scriptProperties['id']);
return;
}
$editor = $resource->get('editedby');
if (! $editor) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'editedby is empty');
return;
}
$user=$modx->getObject('modUser',array('id'=>$editor));
if (!$user) {
$modx->log(MODX::LOG_LEVEL_ERROR, 'user is empty');
return;
}
$checkMembership = $user->isMember($usergroup);
$state = $resource->getTVValue('approvalSwitch');
if ($state=='yes' && $checkMembership==true) {
return true;
}
return false;