Hello. I have managed to get the Update User Profile plugin to send out an email to the email address (to admin email) typed into the plugin.
Is there a way to also send to the user and even additional email address fields in the profile e.g. email (default user email), customemail2 (another field in the profile), customemail3 (another field in the profile)
Here is part of the php for the plugin. Can the additional email fields (default user email, customemail2, customemail3) be added here to send out additional emails?
In addition to sending out to admin email typed into the plugin, it would be nice to also send to user default email and additional custome emails.
I tried to add here but it did not work:
$this->params->get('email','customeemail2','customeemail3',''), // Receiver Mail
Thanks in advance
**************************
public function triggerProfileUpdate($user, &$data, $changed, $isNew)
{
if(!$isNew)
{
// Start body of email
$body=$user->name." updated his profile. \n\n";
// Add fields to body email
foreach($changed as $fieldalias){
$body.=$fieldalias .": ". $data[$fieldalias] ."\n";
}
//die($this->params->get('email',''));
// Send Email
$result=JFactory::getMailer()->sendMail(
$user->email, // Sender Mail
$user->name, // Sender Name
$this->params->get('email',''), // Receiver Mail
'Profile Updated', // Subject Mail
$body // Body Mail
);
}