ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilRegistrationMailNotification Class Reference
+ Inheritance diagram for ilRegistrationMailNotification:
+ Collaboration diagram for ilRegistrationMailNotification:

Public Member Functions

 send ()
 Parse and send mail. More...
 
- Public Member Functions inherited from ilMailNotification
 __construct (bool $a_is_personal_workspace=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 ()
 

Data Fields

const TYPE_NOTIFICATION_APPROVERS = 30
 
const TYPE_NOTIFICATION_CONFIRMATION = 31
 
- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 

Protected Member Functions

 initLanguage (int $a_usr_id)
 
- 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")
 

Additional Inherited Members

- 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 = []
 
bool $is_in_wsp
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $wsp_access_handler
 

Detailed Description

Member Function Documentation

◆ initLanguage()

ilRegistrationMailNotification::initLanguage ( int  $a_usr_id)
protected

Definition at line 102 of file class.ilRegistrationMailNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

102  : void
103  {
104  parent::initLanguage($a_usr_id);
105  $this->getLanguage()->loadLanguageModule('registration');
106  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ilRegistrationMailNotification::send ( )

Parse and send mail.

Returns

Definition at line 34 of file class.ilRegistrationMailNotification.php.

References ilLink\_getStaticLink(), ilMailNotification\appendBody(), ilMailNotification\getAdditionalInformation(), ILIAS\Survey\Mode\getId(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilMailNotification\getRecipients(), ilMail\getSalutation(), ilMailNotification\getType(), initLanguage(), ilMailNotification\initMail(), ilMailNotification\sendMail(), ilMailNotification\setBody(), and ilMailNotification\setSubject().

34  : void
35  {
36  switch ($this->getType()) {
37  case self::TYPE_NOTIFICATION_APPROVERS:
38 
39  foreach ($this->getRecipients() as $rcp) {
40  $this->initLanguage($rcp);
41  $this->initMail();
42  $this->setSubject(
43  $this->getLanguageText('reg_mail_new_user')
44  );
45 
46  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
47  $this->appendBody("\n\n");
48 
49  $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
50  $this->appendBody("\n\n");
51  $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
52 
53  $info = $this->getAdditionalInformation();
54 
55  $this->appendBody("\n\n");
56  $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
57 
58  $this->appendBody("\n\n");
59  $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
60 
61  $this->getMail()->appendInstallationSignature(true);
62  $this->sendMail([$rcp]);
63  }
64  break;
65 
66  case self::TYPE_NOTIFICATION_CONFIRMATION:
67 
68  foreach ($this->getRecipients() as $rcp) {
69  $this->initLanguage($rcp);
70  $this->initMail();
71  $this->setSubject(
72  $this->getLanguageText('reg_mail_new_user_confirmation')
73  );
74 
75  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
76  $this->appendBody("\n\n");
77 
78  $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
79  $this->appendBody("\n\n");
80  $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
81 
82  $info = $this->getAdditionalInformation();
83 
84  $this->appendBody("\n\n");
85  $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
86 
87  $this->appendBody("\n\n");
88  $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
89  $this->appendBody("\n"); // #4527
90  $this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
91 
92  $this->appendBody("\n\n");
93  $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
94 
95  $this->getMail()->appendInstallationSignature(true);
96  $this->sendMail([$rcp]);
97  }
98  break;
99  }
100  }
sendMail(array $a_rcp, bool $a_parse_recipients=true)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
getLanguageText(string $a_keyword)
setSubject(string $a_subject)
+ Here is the call graph for this function:

Field Documentation

◆ TYPE_NOTIFICATION_APPROVERS

const ilRegistrationMailNotification::TYPE_NOTIFICATION_APPROVERS = 30

◆ TYPE_NOTIFICATION_CONFIRMATION

const ilRegistrationMailNotification::TYPE_NOTIFICATION_CONFIRMATION = 31

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