1. sarah-krajewski
  2. General
  3. Monday, May 09 2016, 11:23 AM
Hi -
I saw this thread already but I have no coding skills.
http://docs.easy-profile.com/index.php/article/triggers

I have a simple plugin that sends an email to the superuser (or a custom email address).
Problem is it only gives me this:

Username: Doe, John
User ID: John
has just updated his/her profile.
(see plugin attached)


Is there an easy way to modify the plugin to get all fields or ideally the fields that have been changed?
Thanks!
Attachments (1)
admin Accepted Answer
Admin
Hi,
sorry for late reply,

With our APIs you can build a simple plugin that do this (docs with example plugin at http://docs.easy-profile.com/index.php/article/triggers)
- Download, Install and Enable Skeleton Plugin (you will find it at http://docs.easy-profile.com/index.php/article/triggers)
- Open file /plugins/jsn/skeleton/skeleton.php
- remove samples functions: triggerFieldAvatarUpdate, triggerProfileUpdate
- add function like this:
public function triggerProfileUpdate($user, &$data, $changed, $isNew)
{
if(!$isNew)
{
// Start body of email
$body=$user->name." updated user profile. \n\n";

// Add fields to body email
foreach($changed as $fieldalias){
$body.=$fieldalias .": ". $data[$fieldalias] ."\n";
}

// Send Email
$result=JFactory::getMailer()->sendMail(
$user->email, // Sender Mail
$user->name, // Sender Name
'[email protected]', // Receiver Mail
'Profile Updated', // Subject Mail
$body // Body Mail
);
}
}

NOTE: This code is not tested and not supported, this is only for example purpose.
  1. more than a month ago
  2. General
  3. # 1
sarah-krajewski Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 2
admin Accepted Answer
Admin
Hi,
seems to missing "}" char at the end of file to close the Class "PlgJsnSkeleton"
  1. more than a month ago
  2. General
  3. # 3
sarah-krajewski Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 4
sarah-krajewski Accepted Answer
solved - this is the code I used...
class PlgJsnSkeleton extends JPlugin
{

public function triggerProfileUpdate($user, &$data, $changed, $isNew)
{
if(!$isNew)
{
// Start body of email
$body=$user->name." updated user profile. \n\n";

// Add fields to body email
foreach($changed as $fieldalias){
$body.=$fieldalias .": ". $data[$fieldalias] ."\n";
}

// Send Email
$result=JFactory::getMailer()->sendMail(
$user->email, // Sender Mail
$user->name, // Sender Name
'[email protected]', // Receiver Mail
'Profile Updated', // Subject Mail
$body // Body Mail
);
}
}
}
?>
  1. more than a month ago
  2. General
  3. # 5
namly161 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 6
admin Accepted Answer
Admin
Hi,
read docs about Joomla Mailer at https://docs.joomla.org/Sending_email_from_extensions
  1. more than a month ago
  2. General
  3. # 7
namly161 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 8
namly161 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 9
admin Accepted Answer
Admin
Hi,
try this:

$mailer = JFactory::getMailer();
$recipient = array( '[email protected]', '[email protected]', '[email protected]' );
$result=JFactory::getMailer()->sendMail(
$user->email, // Sender Mail
$user->name, // Sender Name
$recipient, // Receiver Mail
'Profile Updated', // Subject Mail
$body // Body Mail
);


I don't know if code above will works, we does not test and does not support custom code.
  1. more than a month ago
  2. General
  3. # 10
namly161 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 11
namly161 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 12
admin Accepted Answer
Admin
Hi,
I'm sorry but we do not do custom works, we support Easy Profile as it is. Of course, we can point you on the right way but we can't do this for you.

I hope you can understand.
  1. more than a month ago
  2. General
  3. # 13
namly161 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 14
namly161 Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 15
admin Accepted Answer
Admin
Hi,
as I said:
I'm sorry but we do not do custom works, we support Easy Profile as it is. Of course, we can point you on the right way but we can't do this for you.


I don't think that is custom works
This is not a Easy Profile feature and provide code require time only for your needs. An example also in this post (about multiple email addresses to send email), Joomla API to send emails are public and not developed by us. to reply to your previous problem, I have to search, read and study Joomla documentation.

This Easy Profile is component for management info user
It is not so, Users are managed by Joomla and not Easy Profile.

What is Easy Profile?
from home page
Easy Profile is a powerful profiler extension, it extends Joomla user profile management by adding custom fields and many other features

All features are explained in home page.

Easy Profile does what it says, nothing more. We trust in our product, but it can not do magic to meet all needs

I think this is not respectful by you, you have asked over 30 questions and in the most of cases you want something that Easy Profile does not do, and many time we helped you. You have paid for download service and support service only related to Easy Profile. You have not paid for the developers's Team at your service. We already sell these services with a very low price (this is not my opinion, this is based on competitor prices).

Please do not take advantage of us and in our desire and passion in helping our customers.
  1. more than a month ago
  2. General
  3. # 16
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.