doesn't pure php/xpdo work?
lets say you have a field user_id in your project and an aggregate in your xpdo-schema with:
<aggregate alias="User" class="modUser" local="user_id" foreign="id" cardinality="one" owner="foreign" />
and in your note an aggregate with:
<aggregate alias="Project" class="Project" local="project_id" foreign="id" cardinality="one" owner="foreign" />
and in your processor something like that:
$classname = 'Note';
$object = $modx->newObject($classname);
$object->fromArray($postArray);
if ($object->save(){
if ($project = $object->getOne('Project')){
if ($user = $project->getOne('User')){
if ($profile = $user->getOne('Profile')){
$email = $profile->get('email');
//send the mail here
}
}
}
}
You could also use $modx->invokeEvent() to fire a system event in your CMPs code (either an existing event, or one you create). Then you could use a plugin attached to that event to send the email.
For that matter, why not just send the email in the code that writes to the table?
Quote from: mandledesign at Dec 19, 2013, 10:59 AMQuote from: Bruno17 at Dec 19, 2013, 01:24 AMdoesn't pure php/xpdo work?
I should have explained that I used migxdb to create the CMP.
well then, a custom update.php - processor in your folder:
core/components/{yourPackage}/processors/mgr/default/update.php
or
core/components/{yourPackage}/processors/mgr/{yourProcessorsPath}/update.php
as a copy of
core/components/migx/processors/mgr/default/update.php
with something like the code above after
should do it.