ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 (protected bool $is_in_wsp=false)
 
 setType (int $a_type)
 
 getType ()
 
 setSender (int $a_usr_id)
 
 getSender ()
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 
 setAttachments (array $a_att)
 
 getAttachments ()
 
 setLangModules (array $a_modules)
 
 getUserLanguage (int $a_usr_id)
 
 setRefId (int $a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId (int $a_obj_id)
 
 getObjType ()
 
 setAdditionalInformation (array $a_info)
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, bool $a_parse_recipients=true)
 
 getBlockBorder ()
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
final const int SUBJECT_TITLE_LENGTH = 60
 
- Protected Member Functions inherited from ilMailNotification
 setSubject (string $a_subject)
 
 getSubject ()
 
 setBody (string $a_body)
 
 appendBody (string $a_body)
 
 getBody ()
 
 initLanguage (int $a_usr_id)
 
 initLanguageByIso2Code (string $a_code='')
 
 setLanguage (ilLanguage $a_language)
 
 getLanguage ()
 
 getLanguageText (string $a_keyword)
 
 getObjectTitle (bool $a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink (array $a_params=[], string $a_append='')
 
 userToString (int $a_usr_id)
 
 isRefIdAccessible (int $a_user_id, int $a_ref_id, string $a_permission='read')
 
- Protected Attributes inherited from ilMailNotification
int $type
 
int $sender
 
ilMail $mail = null
 
string $subject = ''
 
string $body = ''
 
array $attachments = []
 
ilLanguage $language
 
array $lang_modules = []
 
array $recipients = []
 
int $ref_id
 
int $obj_id = 0
 
string $obj_type = ''
 
array $additional_info = []
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $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 28 of file class.ilTestMailNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestMailNotification::__construct ( )

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

References ILIAS\GlobalScreen\Provider\__construct().

31  {
33  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

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
string$usr_data
array$file_names

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

References ilMailNotification\appendBody(), ilDatePresentation\formatDate(), ilMailNotification\getLanguage(), ilMailNotification\getMail(), ilMail\getSalutation(), IL_CAL_UNIX, ilMailNotification\initLanguage(), ilMailNotification\initMail(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ilMailNotification\sendMail(), ilMailNotification\setAttachments(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ilDatePresentation\setUseRelativeDates().

77  {
78  $this->initLanguage($owner_id);
79  $this->language->loadLanguageModule('assessment');
80 
81  $this->initMail();
82  $this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
83  $this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
84  $this->appendBody("\n\n");
85  $this->appendBody($this->language->txt('user_has_finished_a_test'));
86  $this->appendBody("\n\n");
87 
88  $this->appendBody($this->language->txt('title') . ': ' . $title);
89  $this->appendBody("\n");
90  $this->appendBody($this->language->txt('tst_participant') . ': ' . $usr_data);
91  $this->appendBody("\n");
92 
94  $this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
95  $this->appendBody("\n\n");
96 
97  $this->appendBody($this->language->txt('tst_attached_xls_file'));
98  $this->appendBody("\n\n");
99 
100  $this->appendBody($this->language->txt('tst_notification_explanation_admin'));
101  $this->appendBody("\n");
102 
103  $this->setAttachments($file_names);
104  $this->getMail()->appendInstallationSignature(true);
105 
106  $this->sendMail([$owner_id]);
107  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
sendMail(array $a_rcp, bool $a_parse_recipients=true)
const IL_CAL_UNIX
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
setSubject(string $a_subject)
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ 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 42 of file class.ilTestMailNotification.php.

References ilMailNotification\appendBody(), ilDatePresentation\formatDate(), ilMailNotification\getLanguage(), ilMailNotification\getMail(), ilMail\getSalutation(), IL_CAL_UNIX, ilMailNotification\initLanguage(), ilMailNotification\initMail(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ilMailNotification\sendMail(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ilDatePresentation\setUseRelativeDates().

43  {
44  $this->initLanguage($owner_id);
45  $this->language->loadLanguageModule('assessment');
46  $this->initMail();
47  $this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
48  $this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
49  $this->appendBody("\n\n");
50  $this->appendBody($this->language->txt('user_has_finished_a_test'));
51  $this->appendBody("\n\n");
52 
53  $this->appendBody($this->language->txt('title') . ': ' . $title);
54  $this->appendBody("\n");
55  $this->appendBody($this->language->txt('tst_participant') . ': ' . $usr_data);
56  $this->appendBody("\n");
57 
59  $this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
60  $this->appendBody("\n\n");
61 
62  $this->appendBody($this->language->txt('tst_notification_explanation_admin'));
63  $this->appendBody("\n");
64  $this->getMail()->appendInstallationSignature(true);
65 
66  $this->sendMail([$owner_id]);
67  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
sendMail(array $a_rcp, bool $a_parse_recipients=true)
const IL_CAL_UNIX
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
setSubject(string $a_subject)
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

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