Welcome, Guest
Please Login or Register.    Lost Password?

Excessive sendEmailNotification when admin amends
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Excessive sendEmailNotification when admin amends
#7487
Excessive sendEmailNotification when admin amends 6 Years, 5 Months ago Karma: 0
When logged in to front end as a SU, or even an Administrator user, any edit of attendees table eg on behalf of another user at their request, or after adding columns, results in a notification email for each of the users in the table?? eg 9 for 9 user rows. An ordinary (Special, logged in) user adding a new row ie for the first time on this proposal, does send only one, useful email.

I have been looking at attendees.php, there does seem to be a foreach loop, wonder if I could inhibit this behaviour for activity by eg userid for SUs and Adminstrators ? Or just only let "ordinary users" logged in, edit their own/any rows? I need to notify the Owner(s) who may well need to be Admins as well. Not visble to Public, so may to give you a loginor two?

Thanks
Trevor
trebone
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#7488
Re: Excessive sendEmailNotification when admin amends 6 Years, 5 Months ago Karma: 13
Thank you for your feedback Trevor.
We will analyze how we could improve the behavior.

If you want to 'hack' the behavior to avoid sending email when you are logged as SU, you could add a test inside the sendEmailNotification() function to verify if you are logged as SU.
Another place where you could touch could be inside the saveDecisions() where the flag sendNotification is computed.
This flag is enabled when the "attends" info is correctly saved.
So you could condition the sendNotification flag according the current logged user (SU or not).

To know if you are currently logged as SU, here it is a sample of code
$isSuperUser = JFactory::getUser()->authorise('core.admin');
edwin2win
Moderator
Posts: 1434
graph
User Offline Click here to see the profile of this user
Last Edit: 2018/06/15 09:34 By edwin2win.
The administrator has disabled public write access.
 
#7489
Re: Excessive sendEmailNotification when admin amends 6 Years, 5 Months ago Karma: 0
Hello, I find I can affect the emails by adding code to attendees.php to test $user_id or $userId against a small array of Admin and SU ids; I can therefore suppress the sending of emails for those 3 users in the List of Attendees who ARE in the array, or change the subject of all the 9 emails to indicate which are admins and which are not.

What I need is that which happens when a logged-in non-admin/SU amends his own row and saves: one email for him (it would be nice to show which Proposal Date(s) he amended, and at least, what the new value is, to alert the "team leader");

what happens when an Admin (administrator or SU) amends any column in his HIS (being a team member) or any other person's row on that person's behalf, or changing the Undefined entries on a newly added column to Perhaps or No, is that we always get an email for everyone, changed or not. What I can't do is see whether the code tests the values of the Decisions before and after, so that we only send an email then? My grasp of PHP is not sufficient I am afraid to understand where this test of values might be included?

Any suggestions please?

Thanks
Trevor
trebone
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#7490
Re: Excessive sendEmailNotification when admin amends 6 Years, 5 Months ago Karma: 13
Concerning the second point, you can add in the back-end, in the "EMail Notification" a list of user to whom send a copy of the email.
So you can decide to send an alert to the "Team Leader".

Concerning the 3rd point, the notification is sent when a decision is saved successfully. (The flag $sendNotification = true). So the notification is sent after having saved the decision in the DB.
edwin2win
Moderator
Posts: 1434
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#7491
Re: Excessive sendEmailNotification when admin amends 6 Years, 5 Months ago Karma: 0
Hello, I am continuing to make small changes to the code and try and improve the usefulness of the emails ARE sent, when a non-admin amends their own row, and trying to make all joomla registered users do their own!

Do you wish that I come back if I have time for any breakthroughs? If you want to close this ticket, please do so, will I be able to add news later?
Thanks
Trevor
trebone
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#7493
Re: Excessive sendEmailNotification when admin amends 6 Years, 4 Months ago Karma: 13
Dear Trevor, you can of course continue making changes and give details in the forum.
You are welcome.

If you also want sharing your development to potentially integrate your changes into the extension, you are can also send us a copy of your changes by email for review.
edwin2win
Moderator
Posts: 1434
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop