ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilRegistrationMailNotification Class Reference
+ Inheritance diagram for ilRegistrationMailNotification:
+ Collaboration diagram for ilRegistrationMailNotification:

Public Member Functions

 __construct ()
 Default constructor. More...
 
 send ()
 Parse and send mail. 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...
 

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 ($a_usr_id)
 Add language module registration. More...
 
- 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...
 

Additional Inherited Members

- 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

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilRegistrationMailNotification::__construct ( )

Default constructor.

Returns

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

24  {
25  parent::__construct();
26  }

Member Function Documentation

◆ initLanguage()

ilRegistrationMailNotification::initLanguage (   $a_usr_id)
protected

Add language module registration.

Parameters
object$a_usr_id
Returns

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

References ilMailNotification\getLanguage().

Referenced by send().

109  {
110  parent::initLanguage($a_usr_id);
111  $this->getLanguage()->loadLanguageModule('registration');
112  }
+ 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 32 of file class.ilRegistrationMailNotification.php.

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

33  {
34  switch ($this->getType()) {
35  case self::TYPE_NOTIFICATION_APPROVERS:
36 
37  foreach ($this->getRecipients() as $rcp) {
38  $this->initLanguage($rcp);
39  $this->initMail();
40  $this->setSubject(
41  $this->getLanguageText('reg_mail_new_user')
42  );
43 
44  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
45  $this->appendBody("\n\n");
46 
47  $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
48  $this->appendBody("\n\n");
49  $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
50 
52 
53  $this->appendBody("\n\n");
54  $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
55 
56  $this->appendBody("\n\n");
57  $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
58 
59  $this->getMail()->appendInstallationSignature(true);
60  $this->getMail()->enableSoap(false);
61  $this->sendMail(array($rcp), array('system'));
62  }
63  break;
64 
65  case self::TYPE_NOTIFICATION_CONFIRMATION:
66 
67  foreach ($this->getRecipients() as $rcp) {
68  $this->initLanguage($rcp);
69  $this->initMail();
70  $this->setSubject(
71  $this->getLanguageText('reg_mail_new_user_confirmation')
72  );
73 
74  $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
75  $this->appendBody("\n\n");
76 
77  $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
78  $this->appendBody("\n\n");
79  $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
80 
82 
83  $this->appendBody("\n\n");
84  $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
85 
86  $this->appendBody("\n\n");
87  $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
88  $this->appendBody("\n"); // #4527
89  include_once "Services/Link/classes/class.ilLink.php";
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->getMail()->enableSoap(false);
97  $this->sendMail(array($rcp), array('system'));
98  }
99  break;
100  }
101  }
getType()
Get notification type.
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
getRecipients()
get array of recipients
appendBody($a_body)
Append body text.
$info
Definition: index.php:5
initLanguage($a_usr_id)
Add language module registration.
static getSalutation($a_usr_id, ilLanguage $a_language=null)
+ 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: