ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilNotificationMailHandler.php
Go to the documentation of this file.
1 <?php
2 require_once 'Services/Notifications/classes/class.ilNotificationHandler.php';
3 
8 {
9  public function notify(ilNotificationObject $notification)
10  {
11  // use a specific sender or ANONYMOUS
12  $sender_id = (isset($notification->handlerParams['mail']['sender']) ? $notification->handlerParams['mail']['sender'] : ANONYMOUS_USER_ID);
13  include_once 'Services/Mail/classes/class.ilMail.php';
14  $mail = new ilMail($sender_id);
15  $mail->appendInstallationSignature(true);
16  $mail->enqueue(
17  $notification->user->getLogin(),
18  '',
19  '',
20  $notification->title,
21  $notification->longDescription,
22  []
23  );
24 
25  //mail($notification->user->getEmail(), $notification->title, $notification->longDescription);
26  }
27 }
const ANONYMOUS_USER_ID
Definition: constants.php:25
Notification handler for sending notifications the to recipients email address.
A concrete notification based on the ilNotificationConfiguration and returned by ilNotificationConfig...
Base class for notification handlers.
notify(ilNotificationObject $notification)