ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 Constructor. More...
 
 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 ($a_rcp)
 set mail recipients More...
 
 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)
 Set ref id. More...
 
 getRefId ()
 get reference id More...
 
 getObjId ()
 get object id More...
 
 setObjId ($a_obj_id)
 set obj id More...
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation ($a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 Get additional information for generating notification mails. More...
 
 sendMail ($a_rcp, $a_type, $a_parse_recipients=true)
 Send Mail. More...
 
 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)
 Set mail subject. More...
 
 getSubject ()
 Get mail subject. More...
 
 setBody ($a_body)
 Set mail body. More...
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 Get body. More...
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 A language. More...
 
 getLanguage ()
 get language object More...
 
 getLanguageText ($a_keyword)
 Replace new lines. More...
 
 getObjectTitle ($a_shorten=false)
 Get object title. More...
 
 initMail ()
 Init mail. More...
 
 getMail ()
 Get mail object. More...
 
 createPermanentLink ($a_params=array(), $a_append='')
 Create a permanent link for an object. More...
 
 userToString ($a_usr_id)
 Utility function. More...
 
 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 111 of file class.ilRegistrationMailNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

112  {
113  parent::initLanguage($a_usr_id);
114  $this->getLanguage()->loadLanguageModule('registration');
115  }
getLanguage()
get language object
+ 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 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  {
36  case self::TYPE_NOTIFICATION_APPROVERS:
37 
38  foreach($this->getRecipients() as $rcp)
39  {
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->getMail()->enableSoap(false);
63  $this->sendMail(array($rcp),array('system'));
64  }
65  break;
66 
67  case self::TYPE_NOTIFICATION_CONFIRMATION:
68 
69  foreach($this->getRecipients() as $rcp)
70  {
71  $this->initLanguage($rcp);
72  $this->initMail();
73  $this->setSubject(
74  $this->getLanguageText('reg_mail_new_user_confirmation')
75  );
76 
77  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
78  $this->appendBody("\n\n");
79 
80  $this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
81  $this->appendBody("\n\n");
82  $this->appendBody($this->getLanguageText('reg_mail_body_profile'));
83 
84  $info = $this->getAdditionalInformation();
85 
86  $this->appendBody("\n\n");
87  $this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
88 
89  $this->appendBody("\n\n");
90  $this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
91  $this->appendBody("\n"); // #4527
92  include_once "Services/Link/classes/class.ilLink.php";
93  $this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
94 
95  $this->appendBody("\n\n");
96  $this->appendBody($this->getLanguageText('reg_mail_body_reason'));
97 
98  $this->getMail()->appendInstallationSignature(true);
99  $this->getMail()->enableSoap(false);
100  $this->sendMail(array($rcp),array('system'));
101  }
102  break;
103  }
104  }
getLanguage()
get language object
getType()
Get notification type.
setBody($a_body)
Set mail body.
sendMail($a_rcp, $a_type, $a_parse_recipients=true)
Send Mail.
getLanguageText($a_keyword)
Replace new lines.
setSubject($a_subject)
Set mail subject.
getAdditionalInformation()
Get additional information for generating notification mails.
static getSalutation($a_usr_id, $a_language=null)
Get salutation.
getRecipients()
get array of recipients
appendBody($a_body)
Append body text.
initLanguage($a_usr_id)
Add language module registration.
+ 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: