$email = new eMail(); $email->set_email($mail); $success &= $email->remove($USER->id, $courseid, $folder->id, true); } if ($success) { notify(get_string('removeok', 'block_email_list'), 'notifysuccess'); } else { notify(get_string('removefail', 'block_email_list')); } break; case 'toread': $success = true; foreach ($mailids as $mail) { $email = new eMail(); $email->set_email($mail); $success &= $email->mark2read($USER->id, $courseid, true); } if ($success) { notify(get_string('toreadok', 'block_email_list'), 'notifysuccess'); } else { notify(get_string('failmarkreaded', 'block_email_list')); } break; case 'tounread': $success = true; foreach ($mailids as $mail) { $email = new eMail(); $email->set_email($mail); $success &= $email->mark2unread($USER->id, $courseid, true); } if ($success) {