It would be awesome if there was a way to be notified, let's say, if a user changed their address (or any specific fields), in their profile.
That way we could use this system to update our regular CRM manually when there is a change.
triggerFieldAvatarUpdate($user,$data,$changed){
echo $user->avatar; //Old avatar path
echo $data[avatar]; //New avatar path
}
triggerProfileUpdate($user,$data,$changed){
if(in_array('avatar',$changed)){
echo $user->avatar; //Old avatar path
echo $data[avatar]; //New avatar path
}
}
defined('_JEXEC') or die;
class PlgJsnSkeleton extends JPlugin
{
function triggerProfileUpdate($user,$data,$changed){
JFactory::getMailer()->sendMail(
$user->email, // Sender Mail
$user->name, // Sender Name
'[email protected]', // Receiver Mail
'Nutzerdaten aktualisiert', // Subject Mail
'Mitglied '.$user->name.', Mitgliedsnummer '.$user->username.' hat seine Daten modifiziert.'."\n\n".
'E-Mail: '.$user->email."\n\n".
'Strasse: '.$user->street."\n".
'Ort: '.$user->plz.' '.$user->ort."\n\n".
'Niederlassung: '.$user->location."\n\n".
'VG: '.$user->vg.', Stufe: '.$user->stufe.', Band: '.$user->band // Body Mail
);
}
}
?>
if(in_array('value_xy',$changed)){
function triggerProfileUpdate($user,$data,$changed){
$abc=$data['email'];
{
if ($user->username < 20000) {
JFactory::getMailer()->sendMail(
...
);
if ($user->username > 20000) {
JFactory::getMailer()->sendMail(
...
function triggerProfileUpdate($user,$data,$changed){
function triggerProfileUpdate($user,$data,$changed,$isNew){
if(!$isNew){