Send email to user manager from Email to (eval)

confis

Member
Hi,

I have table with manager and user - every manager can have one or more users
the scenario is:
User A update field X and the manager of this User A need to get an email with the change in order to approve it.

i believe the right way is to make it is with Email to (eval) but i need some idea how to do it


upload_2017-3-2_19-41-5.png

I have try this
upload_2017-3-2_19-48-55.png

but ... no email

Please advice
 
Thank you for your answer ,
I need to send email to the manager of the login user - not the the login user
 
You'll need to describe the structure if the table that you posted a pic of. Are the employee and manager fields user ids?



Sent from my HTC 10 using Tapatalk
 
Hi,

This is the table
upload_2017-3-7_10-9-57.png

manager column is the manager id
manager_email column is the manager email
user_id is the login user how request from manager to approve
email need to send to the manager_email for this user

i.e
if user_id 740 send the request form , the email need to send to his manager_email confis@gmail.com (manager id: 738)
 
Hi Guys,
I manage to find my issue

this is a working code
PHP:
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);

$myQuery
  ->select('manager_email')
  ->from('fab_users')
  ->where('user_id = ' . $myDb->quote('{fab_calender___user_id_raw}'));

$myDb->setQuery($myQuery);
$manager_email = $myDb->loadResult();
return $manager_email;

my mistake was that all the wrong table (I query jos_users instead of fab_users)
the debug for this was much easy for me when I run it with calc element to check the result. much easy then debugging the form submission
Thanks
Yaniv
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top