ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestMailNotification Class Reference

Class ilTestMailNotification. More...

+ Inheritance diagram for ilTestMailNotification:
+ Collaboration diagram for ilTestMailNotification:

Public Member Functions

 __construct ()
 
 sendSimpleNotification ($owner_id, $title, $usr_data)
 Send a simple notification to the owner of the test. More...
 
 sendAdvancedNotification ($owner_id, $title, $usr_data, $file_names)
 send an advanced notification to the owner of the test More...
 
- Public Member Functions inherited from ilMailNotification
 __construct ($a_is_personal_workspace=false)
 
 setType ($a_type)
 Set notification type. More...
 
 getType ()
 Get notification type. More...
 
 setSender ($a_usr_id)
 Set sender of mail. More...
 
 getSender ()
 get sender of mail More...
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 get array of recipients More...
 
 setAttachments ($a_att)
 Set attachments. More...
 
 getAttachments ()
 Get attachments. More...
 
 setLangModules (array $a_modules)
 Set lang modules. More...
 
 getUserLanguage ($a_usr_id)
 Get user language. More...
 
 setRefId ($a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId ($a_obj_id)
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation (array $a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, $a_type, $a_parse_recipients=true)
 
 getBlockBorder ()
 Get (ascii) block border. More...
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 
- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 
 getSubject ()
 
 setBody ($a_body)
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 
 getLanguage ()
 
 getLanguageText ($a_keyword)
 
 getObjectTitle ($a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink ($a_params=array(), $a_append='')
 
 userToString ($a_usr_id)
 
 isRefIdAccessible ($a_user_id, $a_ref_id, $a_permission="read")
 Check if ref id is accessible for user. More...
 
- Protected Attributes inherited from ilMailNotification
 $type = null
 
 $sender = null
 
 $mail = null
 
 $subject = ''
 
 $body = ''
 
 $attachments = array()
 
 $language = null
 
 $lang_modules = array()
 
 $recipients = array()
 
 $ref_id = null
 
 $obj_id = null
 
 $obj_type = null
 
 $additional_info = array()
 
 $is_in_wsp
 
 $wsp_tree
 
 $wsp_access_handler
 

Detailed Description

Class ilTestMailNotification.

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:$

Definition at line 13 of file class.ilTestMailNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestMailNotification::__construct ( )

Definition at line 15 of file class.ilTestMailNotification.php.

16  {
17  parent::__construct();
18  }

Member Function Documentation

◆ sendAdvancedNotification()

ilTestMailNotification::sendAdvancedNotification (   $owner_id,
  $title,
  $usr_data,
  $file_names 
)

send an advanced notification to the owner of the test

Parameters
int$owner_id
string$title
sting$usr_data
array$file_names

Definition at line 61 of file class.ilTestMailNotification.php.

References $title, ilMailNotification\appendBody(), ilDatePresentation\formatDate(), ilMailNotification\getLanguage(), ilMailNotification\getMail(), ilMail\getSalutation(), IL_CAL_UNIX, ilMailNotification\initLanguage(), ilMailNotification\initMail(), ilMailNotification\sendMail(), ilMailNotification\setAttachments(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ilDatePresentation\setUseRelativeDates().

62  {
63  $this->initLanguage($owner_id);
64  $this->language->loadLanguageModule('assessment');
65 
66  $this->initMail();
67  $this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
68  $this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
69  $this->appendBody("\n\n");
70  $this->appendBody($this->language->txt('user_has_finished_a_test'));
71  $this->appendBody("\n\n");
72 
73  $this->appendBody($this->language->txt('title') . ': ' . $title);
74  $this->appendBody("\n");
75  $this->appendBody($this->language->txt('tst_participant') . ': ' . $usr_data);
76  $this->appendBody("\n");
77 
79  $this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
80  $this->appendBody("\n\n");
81 
82  $this->appendBody($this->language->txt('tst_attached_xls_file'));
83  $this->appendBody("\n\n");
84 
85  $this->appendBody($this->language->txt('tst_notification_explanation_admin'));
86  $this->appendBody("\n");
87 
88  $this->setAttachments($file_names);
89  $this->getMail()->appendInstallationSignature(true);
90 
91  $this->sendMail(array($owner_id), array('system'));
92  }
initLanguage($a_usr_id)
Init language.
setAttachments($a_att)
Set attachments.
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Date and time handling
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
appendBody($a_body)
Append body text.
static getSalutation($a_usr_id, ilLanguage $a_language=null)
+ Here is the call graph for this function:

◆ sendSimpleNotification()

ilTestMailNotification::sendSimpleNotification (   $owner_id,
  $title,
  $usr_data 
)

Send a simple notification to the owner of the test.

Parameters
int$owner_id
string$title
string$usr_data

Definition at line 27 of file class.ilTestMailNotification.php.

References $title, ilMailNotification\appendBody(), ilDatePresentation\formatDate(), ilMailNotification\getLanguage(), ilMailNotification\getMail(), ilMail\getSalutation(), IL_CAL_UNIX, ilMailNotification\initLanguage(), ilMailNotification\initMail(), ilMailNotification\sendMail(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ilDatePresentation\setUseRelativeDates().

28  {
29  $this->initLanguage($owner_id);
30  $this->language->loadLanguageModule('assessment');
31  $this->initMail();
32  $this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
33  $this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
34  $this->appendBody("\n\n");
35  $this->appendBody($this->language->txt('user_has_finished_a_test'));
36  $this->appendBody("\n\n");
37 
38  $this->appendBody($this->language->txt('title') . ': ' . $title);
39  $this->appendBody("\n");
40  $this->appendBody($this->language->txt('tst_participant') . ': ' . $usr_data);
41  $this->appendBody("\n");
42 
44  $this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
45  $this->appendBody("\n\n");
46 
47  $this->appendBody($this->language->txt('tst_notification_explanation_admin'));
48  $this->appendBody("\n");
49  $this->getMail()->appendInstallationSignature(true);
50 
51  $this->sendMail(array($owner_id), array('system'));
52  }
initLanguage($a_usr_id)
Init language.
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Date and time handling
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
appendBody($a_body)
Append body text.
static getSalutation($a_usr_id, ilLanguage $a_language=null)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: