Quote from: BobRay at Oct 23, 2014, 08:46 PMSorry, no. I've never done anything similar that I can recall.
Can you post the full code of the postHook with the email in it? A PHP syntax error could be stopping the whole thing from working.
Here we go - postHook code as below, this code doesn't include the email bit, but it's not even working like this I don't think - when you his submit to change profile updates - the page goes blank - I can't see the updates confirmed label or the output to show what profile fields were updated. Think the issues are in this not the email bit...
I was trying to output the content of the output variable to the error console...
<?php
$oldProfile = isset($_SESSION['user_profile'])
? $_SESSION['user_profile']
: array();
$profile = $modx->user->getOne('Profile');
if ($profile) {
$newProfile = $profile->toArray();
}
$output = '';
if (!empty($newProfile) && (!empty($oldProfile))) {
foreach ($newProfile as $key => $value) {
if ($oldProfile['key'] != $newProfile['key']) {
$output .= '<br />' . $key . ' changed from ' . $oldProfile['key'] . ' to ' . $newProfile['key'];
}
}
}
if (!empty($output)) {
$output = '<br />Changes:<br />' . $output;
} else {
$output = '<br />Changes: none<br />';
}
/* Change report will be in the $output variable here */
$modx->log(modX::LOG_LEVEL_ERROR,'Profile update: $output'.$err);
/* tell our snippet we're good and can continue */
return true;