Support

  1. itadminguy
  2. General
  3. Thursday, July 06 2017, 04:53 AM
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
);
}
admin Accepted Answer
Admin
Hi,
sorry but we does not support custom code, anyway some tip for you:
$this->params->get('email','customeemail2','customeemail3',''), // Receiver Mail
this is totally wrong, you should use something like
array( $data['email'], $data['customeemail2'], $data['customeemail3'] ), // Receiver Mail

in function getMailer->sendMail you can use array to add multiple receivers.

Keep in mind that if there is an error or empty email then entire function JFactory::getMailer()->sendMail will not work, so you should check that variables in $data array are filled.

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
  • Page :
  • 1


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

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.