1. joenglesson
  2. Features Request
  3. Thursday, January 16 2014, 08:22 PM
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.
admin Accepted Answer
Admin
Hi,
for now not! but it is possible that in future we will implement some trigger for this.
Now, the only trigger that you can use is 'onUserAfterSave' (it is built in Joomla).
With event 'onUserAfterSave' you can get all the field values ​​entered by the user when saving the profile (or registering).
  1. more than a month ago
  2. Features Request
  3. # 1
admin Accepted Answer
Admin
Hi,
we have released a new version 1.1.3.

In latest release we have added various trigger when profile is updated.

You can create a joomla plugin (type system or jsn).
the new trigger are:
- triggerProfileUpdate($user,$data,$changed)
- triggerField<alias of field>Update($user,$data,$changed)
where $user is a JsnUser object, $data is array of new data, changed is array of changed field.

triggerProfileUpdate is launched when user update your profile
triggerField<alias of field>Update is launched when user update <alias of field>

examples of triggerField<alias of field>Update:

triggerFieldAvatarUpdate($user,$data,$changed){
echo $user->avatar; //Old avatar path
echo $data[avatar]; //New avatar path
}


or

triggerProfileUpdate($user,$data,$changed){
if(in_array('avatar',$changed)){
echo $user->avatar; //Old avatar path
echo $data[avatar]; //New avatar path
}
}


In coming days we will update our documentation with instruction and example plugin.
  1. more than a month ago
  2. Features Request
  3. # 2
Merklin Accepted Answer
Basic
Hi,

I've tried to modify the example with "function onUserAfterSave" but didn't get it working. Can someone maybe give me a hint how to manage that (mail to xyz.ab)

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 3
admin Accepted Answer
Admin
Have you read documentation at http://www.easy-profile.com/docs/44-triggers.html

There is a sample plugin.
Install
Enable it
Edit
  1. more than a month ago
  2. Features Request
  3. # 4
Merklin Accepted Answer
Basic
Hi,

I've read the instructions and had a look at the sample. Than I changed the value "avatar" to the field alias I've created (street), installed, enabled.
But if a user changes the a.m. field, it is saved in the database, but no mail is generated. I have to apalogize, I'm not that familiar with the joomla 3 code so I was asking for a hint for the appropriate code, which generates an email with the changed data.

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 5
admin Accepted Answer
Admin
Hi,

Try to look this post, there are an example for send email http://www.easy-profile.com/support/access-privileges.html#reply-871
  1. more than a month ago
  2. Features Request
  3. # 6
Merklin Accepted Answer
Basic
Hi,

thanks for your help, I finally get it working, but the mail always contains the old data (before saving) and when changing only email-adress, the mail is not triggered.
defined('_JEXEC') or die;

class PlgJsnSkeleton extends JPlugin
{
function triggerProfileUpdate($user,$data,$changed){

JFactory::getMailer()->sendMail(
$user->email, // Sender Mail
$user->name, // Sender Name
'mail@domian.com', // 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
);

}
}
?>


I've tried with and without the if-function
if(in_array('value_xy',$changed)){

but no difference. Got presently no clue, where or what has to be changed.

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 7
admin Accepted Answer
Admin
Hi,

$user is old object user
$data is new data array
$changed is array of changed fields

with if statement you can filter to send email only when changed value_xy fields else email is send on every profile update
  1. more than a month ago
  2. Features Request
  3. # 8
admin Accepted Answer
Admin
$data is passed by reference,
this because you can change the values.

for example:
if you want store a sum of 2 fields
$data['sum']=$data['field1']+$data['field2']
  1. more than a month ago
  2. Features Request
  3. # 9
Merklin Accepted Answer
Basic
Thanks for your explanation. All modified values are sent by mail now except the email itself. If the user only changes his email-adress, the mail is not triggered.
I set up a new variable for each value (example):
function triggerProfileUpdate($user,$data,$changed){
$abc=$data['email'];

This works for all changed values, but not for the mail-adress.

Rgds
Markus
  1. more than a month ago
  2. Features Request
  3. # 10
admin Accepted Answer
Admin
Hi,
you're right, we'll fix in the next release
  1. more than a month ago
  2. Features Request
  3. # 11
Merklin Accepted Answer
Basic
Content Protected
  1. more than a month ago
  2. Features Request
  3. # 12
Merklin Accepted Answer
Basic
Content Protected
  1. more than a month ago
  2. Features Request
  3. # 13
admin Accepted Answer
Admin
Hi,
can you post me the code of your plugin (only interesting part)?
also the name of function and alias of field
  1. more than a month ago
  2. Features Request
  3. # 14
Merklin Accepted Answer
Basic
Hi

thanks for the fast reply. I figured out that a routine I've inserted stopped the process. I tried to sent a mail to two different receivers by inserting:
      {
if ($user->username < 20000) {
JFactory::getMailer()->sendMail(
...
);
if ($user->username > 20000) {
JFactory::getMailer()->sendMail(
...

(username is MemberID, cannot be changed)
Looks like I have to change these (don't know how yet). If I use the plugin without this function, everything is fine.

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 15
Merklin Accepted Answer
Basic
Fixed, thank you

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 16
admin Accepted Answer
Admin
No problem!;)
  1. more than a month ago
  2. Features Request
  3. # 17
Merklin Accepted Answer
Basic
Hi,

I've got the plugin up and running, but now encountered the issue, that a mail is as well triggered, if a new user register himself on the homepage. Is there a way to prevent this behaviour? I've attached the sekeleton.php.

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 18
Merklin Accepted Answer
Basic
Hi,

I've got the plugin up and running, but now encountered the issue, that a mail is as well triggered, if a new user register himself on the homepage. Is there a way to prevent this behaviour? I've attached the skeleton.php as textfile.

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 19
admin Accepted Answer
Admin
Hi
sorry, but I not undestand well.
You want disable to send email to new users?
  1. more than a month ago
  2. Features Request
  3. # 20
Merklin Accepted Answer
Basic
Content Protected
  1. more than a month ago
  2. Features Request
  3. # 21
admin Accepted Answer
Admin
Sorry, but I do not know if I understand.

if you want disable the email from skeleton plugin on registration follow these steps:
replace:
function triggerProfileUpdate($user,$data,$changed){

with:
function triggerProfileUpdate($user,$data,$changed,$isNew){
if(!$isNew){


at the end of function add another } to close the new if statement.

Now the code works only on not new users.

in our triggers we have added a possibility to check if user is new or not.

I hope I was helpful
  1. more than a month ago
  2. Features Request
  3. # 22
Merklin Accepted Answer
Basic
Hi,

thanks for your fast reply. The new function do exactly what I want to achieve. Great job!

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 23
Merklin Accepted Answer
Basic
Hi,
I've tested the plugin on my test-site and it worked fine. Now I've installed it on my live-site. Installation and setup no problem, but if a user changes data, he ends up with a blank page (plugin enabled). The difference between the two sites is, that on the live site SSL is running. If I disable the skeleton plugin, easy profile works excellent. The link to the profile page is SSL-protected (https).
Any ideas or advice?

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 24
admin Accepted Answer
Admin
Hi,
In 99% of cases
Blank page=php error

Try to see your Apache error log.

Sorry for short reply but it's a weekend for us and i write with smartphone.
  1. more than a month ago
  2. Features Request
  3. # 25
Merklin Accepted Answer
Basic
Content Protected
  1. more than a month ago
  2. Features Request
  3. # 26
admin Accepted Answer
Admin
invalid security token is correct, in every form there is a token, you can send the form 2 times.

if send me your site details we will debug the plugin. You can use the form below the reply in Site Details tab.
  1. more than a month ago
  2. Features Request
  3. # 27
Merklin Accepted Answer
Basic
Hi,

thanks for your fast reply, site details are posted.

Rgds

Markus
  1. more than a month ago
  2. Features Request
  3. # 28
admin Accepted Answer
Admin
Hi,
thanks, but I need FTP access to see source code.
  1. more than a month ago
  2. Features Request
  3. # 29
Merklin Accepted Answer
Basic
Hi,

I've updates my previous post with the FTP Details.
  1. more than a month ago
  2. Features Request
  3. # 30
admin Accepted Answer
Admin
ok,
I have found a error in your plugin, too many }
Also I have clean your code in skeleton plugin. and now work.;)
  1. more than a month ago
  2. Features Request
  3. # 31
Merklin Accepted Answer
Basic
Content Protected
  1. more than a month ago
  2. Features Request
  3. # 32
Grant Accepted Answer
  1. more than a month ago
  2. Features Request
  3. # 33
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.