meeting-room-booking-system / mrbs-code

MRBS application code
Other
129 stars 64 forks source link

Only receive email after clicking approve button #2723

Open jberanek opened 4 years ago

jberanek commented 4 years ago

Hello,

Currently I am using version 1.8. I currently have two admin accounts, A and B. Admin B only receives the approved email from A. I want when A clicks the approve button then B will receive the approval email because B doesn't want to receive too many emails.

Reported by: *anonymous

Original Ticket: mrbs/support-requests/2028

jberanek commented 4 years ago

I will "A" do room admin and activate the feature only send to the booker and the room admin

Original comment by: *anonymous

jberanek commented 4 years ago

Sorry, can you explain please a little bit more what you want to happen?

Original comment by: campbell-m

jberanek commented 4 years ago

I want admin account B to only receive approved email notifications. Only receive email as seen below.

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/ddb6381bd2/7031/09b3/attachment/tempsnip.png

jberanek commented 4 years ago

OK. Why is Admin B getting emails at the moment? Is it because they a room_admin? Or an an area_admin? Or in $mail_settings['recipients']?

Original comment by: campbell-m

jberanek commented 4 years ago

This person is only the supervisor of Admin A, when Account A approve

Original comment by: *anonymous

jberanek commented 4 years ago

Yes, but what MRBS setting is causing them to receive emails at the moment?

Original comment by: campbell-m

jberanek commented 4 years ago

I want when the 'A' account clicking the approve button, will send an approved 'A' email to 'B'.

Original comment by: *anonymous

jberanek commented 4 years ago

And is it just when User A approves a booking, or is it anyone?

Original comment by: campbell-m

jberanek commented 4 years ago

anyone who approves in area AA and only A in area BBBB

Original comment by: *anonymous

jberanek commented 4 years ago

And what about other areas? And other users in Area BBBB?

Original comment by: campbell-m

jberanek commented 4 years ago

All other things are normal, just that this user B is outside the scope of room admin and Area admin

Original comment by: *anonymous

jberanek commented 4 years ago

This user B only receives approved email and does not want to receive booking or pending email.

Original comment by: *anonymous

jberanek commented 4 years ago

Yes, but are there are other users that can approve bookings in Area BBBB? And are there other areas apart from AA and BBBB?

Original comment by: campbell-m

jberanek commented 4 years ago

Yes, still. There are still areas other than AA and BBBB

Original comment by: *anonymous

jberanek commented 4 years ago

And are there are other users that can approve bookings in Area BBBB?

Original comment by: campbell-m

jberanek commented 4 years ago

There are other users who can approve reservations in the BBBB Area

Original comment by: *anonymous

jberanek commented 4 years ago

Please help me.

Original comment by: *anonymous

jberanek commented 4 years ago

Try adding the following code to functions_mail.inc at line 863:

  if (($action == 'approve')  &&
      (($data['area_name'] == 'AA') || (($data['area_name'] == 'BBBB') && (utf8_strtolower(getUserName()) == 'a'))))
  {
    $to[] = authGetUserEmail('b');  // User B
  }

ie just before the block:

  // In case $to and $cc are empty, no need to go further
  if (empty($to) && empty($cc))
  {
    return FALSE;
  }

Original comment by: campbell-m

jberanek commented 4 years ago

Thank you very much, but what if I want to add one more person? I tried it like that but couldn't.

if (($action == 'approve')  &&
      (($data['area_name'] == 'AA') || (($data['area_name'] == 'BBBB') && (utf8_strtolower(getUserName()) == 'a'))))
  {
    $to[] = authGetUserEmail('b','bb');  // User B // **add user bb**
  }

Original comment by: *anonymous

jberanek commented 4 years ago
  if (($action == 'approve')  &&
      (($data['area_name'] == 'AA') || (($data['area_name'] == 'BBBB') && (utf8_strtolower(getUserName()) == 'a'))))
  {
    $to[] = authGetUserEmail('b');   // User B
    $to[] = authGetUserEmail('bb');  // User BB
  }

Original comment by: campbell-m

jberanek commented 4 years ago

Thanks Campbell Morrison .

Original comment by: *anonymous