ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailSummaryNotification Class Reference
+ Inheritance diagram for ilMailSummaryNotification:
+ Collaboration diagram for ilMailSummaryNotification:

Public Member Functions

 __construct ()
 send ()
- Public Member Functions inherited from ilMailNotification
 __construct ($a_is_personal_workspace=false)
 Constructor.
 setType ($a_type)
 Set notification type.
 getType ()
 Get notification type.
 setSender ($a_usr_id)
 Set sender of mail.
 getSender ()
 get sender of mail
 setRecipients ($a_rcp)
 set mail recipients
 getRecipients ()
 get array of recipients
 setAttachments ($a_att)
 Set attachments.
 getAttachments ()
 Get attachments.
 setLangModules (array $a_modules)
 Set lang modules.
 getUserLanguage ($a_usr_id)
 Get user language.
 setRefId ($a_id)
 Set ref id.
 getRefId ()
 get reference id
 getObjId ()
 get object id
 setObjId ($a_obj_id)
 set obj id
 getObjType ()
 Get object type.
 setAdditionalInformation ($a_info)
 Additional information for creating notification mails.
 getAdditionalInformation ()
 Get additional information for generating notification mails.
 sendMail ($a_rcp, $a_type, $a_parse_recipients=true)
 Send Mail.
 getBlockBorder ()
 Get (ascii) block border.

Additional Inherited Members

- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 Set mail subject.
 getSubject ()
 Get mail subject.
 setBody ($a_body)
 Set mail body.
 appendBody ($a_body)
 Append body text.
 getBody ()
 Get body.
 initLanguage ($a_usr_id)
 Init language.
 initLanguageByIso2Code ($a_code= '')
 Init language by ISO2 code.
 setLanguage ($a_language)
 A language.
 getLanguage ()
 get language object
 getLanguageText ($a_keyword)
 Replace new lines.
 getObjectTitle ($a_shorten=false)
 Get object title.
 initMail ()
 Init mail.
 getMail ()
 Get mail object.
 createPermanentLink ($a_params=array(), $a_append= '')
 Create a permanent link for an object.
 userToString ($a_usr_id)
 Utility function.
 isRefIdAccessible ($a_user_id, $a_ref_id, $a_permission="read")
 Check if ref id is accessible for user.
- 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
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:$

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

Constructor & Destructor Documentation

ilMailSummaryNotification::__construct ( )

Definition at line 20 of file class.ilMailSummaryNotification.php.

Member Function Documentation

ilMailSummaryNotification::send ( )

Definition at line 25 of file class.ilMailSummaryNotification.php.

References $ilDB, $ilSetting, $lng, ilMailNotification\$mail, $res, $row, ilMailNotification\$sender, ilMail\_getAutoGeneratedMessageString(), ilUtil\_getHttpPath(), ilMail\_getInstallationSignature(), ilObjUser\_lookupEmail(), ilObjUser\_lookupLogin(), ilMailNotification\appendBody(), ilMailNotification\getBody(), ilMail\getIliasMailerAddress(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMail\getSalutation(), ilMailNotification\getSubject(), ilMailNotification\initLanguage(), ilMailNotification\initMail(), ilMailNotification\setBody(), ilMailNotification\setRecipients(), and ilMailNotification\setSubject().

{
global $ilDB, $lng, $ilSetting;
$is_message_enabled = $ilSetting->get("mail_notification_message");
$res = $ilDB->queryF('SELECT mail.* FROM mail_options
INNER JOIN mail ON mail.user_id = mail_options.user_id
INNER JOIN mail_obj_data ON mail_obj_data.obj_id = mail.folder_id
WHERE cronjob_notification = %s
AND send_time >= %s
AND m_status = %s',
array('integer', 'timestamp', 'text'),
array(1, date('Y-m-d H:i:s', time() - 60 * 60 * 24), 'unread')
);
$users = array();
$user_id = 0;
while($row = $ilDB->fetchAssoc($res))
{
if($user_id == 0 || $row['user_id'] != $user_id)
{
$user_id = $row['user_id'];
}
$users[$user_id][] = $row;
}
foreach($users as $user_id => $mail_data)
{
$this->initLanguage($user_id);
$user_lang = $this->getLanguage() ? $this->getLanguage() : $lng;
$this->initMail();
$this->setRecipients($user_id);
$this->setSubject($this->getLanguageText('mail_notification_subject'));
$this->setBody(ilMail::getSalutation($user_id, $this->getLanguage()));
$this->appendBody("\n\n");
if(count($mail_data) == 1)
{
$this->appendBody(sprintf($user_lang->txt('mail_at_the_ilias_installation'), count($mail_data), ilUtil::_getHttpPath()));
}
else
{
$this->appendBody(sprintf($user_lang->txt('mails_at_the_ilias_installation'), count($mail_data), ilUtil::_getHttpPath()));
}
$this->appendBody("\n\n");
$counter = 1;
foreach($mail_data as $mail)
{
$this->appendBody("----------------------------------------------------------------------------------------------");
$this->appendBody("\n\n");
$this->appendBody('#'.$counter."\n\n");
$this->appendBody($user_lang->txt('date') .": ".$mail['send_time']);
$this->appendBody("\n");
if($mail['sender_id'] == ANONYMOUS_USER_ID)
{
$sender = ilMail::_getIliasMailerName();
}
else
{
$sender = ilObjUser::_lookupLogin($mail['sender_id']);
}
$this->appendBody($user_lang->txt('sender') . ": " . $sender);
$this->appendBody("\n");
$this->appendBody($user_lang->txt('subject').": ". $mail['m_subject']);
$this->appendBody("\n\n");
if($is_message_enabled == true)
{
$this->appendBody($user_lang->txt('message').": ". $mail['m_message']);
$this->appendBody("\n\n");
}
++$counter;
}
$this->appendBody("----------------------------------------------------------------------------------------------");
$this->appendBody("\n\n");
$this->appendBody($user_lang->txt('follow_link_to_read_mails')." ");
$this->appendBody("\n");
$mailbox_link = ilUtil::_getHttpPath();
$mailbox_link .= "/goto.php?target=mail&client_id=".CLIENT_ID;
$this->appendBody($mailbox_link);
$this->appendBody("\n\n");
$mmail = new ilMimeMail();
$mmail->autoCheck(false);
$mmail->To(ilObjUser::_lookupEmail($user_id));
$mmail->Subject($this->getSubject());
$mmail->Body($this->getBody());
$mmail->Send();
}
}

+ Here is the call graph for this function:


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