Email form plugin no mail from example php

Kordian

Member
Hello,
You have this as an example of email recipient for the email form plugin on your page:

$myId = $this->data['yourtable___youruser'];
$myId = is_array($myId) ? $myId[0] : $myId;
if (!empty($myId)) {
$myUser = JFactory::getUser((int)$myId);
return $myUser->get('email');
}
return '';

Unfortunatelly this does not work for me. Emails to group are sent with no problem.
Updated fabrik to the latest github, still no go.
Do not even get an error when setting logging to maximum.
Thank you in advance for help!
 
You always return empty string ("") in your last line of code. Just remove the last line or change your code to:
Code:
$myId = $this->data['yourtable___youruser'];
$myId = is_array($myId) ? $myId[0] : $myId;
if (!empty($myId)) {
$myUser = JFactory::getUser((int)$myId);
return $myUser->get('email');
} else {
return '';
}
 
It depends on your element settings.
Better use $myId = $this->data['yourtable___youruser_raw'];
(If custom link is enabled the non_raw value will contain the link, not the userId).
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top