ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilFormatMail Class Reference

Class UserMail this class handles user mails. More...

+ Inheritance diagram for ilFormatMail:
+ Collaboration diagram for ilFormatMail:

Public Member Functions

 ilFormatMail ($a_user_id)
 Constructor setup an mail object.
 formatReplyMessage ()
 format a reply message public
 formatReplySubject ()
 format a reply subject public
 formatReplyRecipientsForCC ()
 get reply recipients for cc public
 formatReplyRecipient ()
 get reply recipient public
 formatForwardSubject ()
 format a forward subject public
 appendSearchResult ($a_names, $a_type)
 append search result to recipient public
 formatLinebreakMessage ($a_message)
 format message according to linebreak option
 appendSignature ()
 append signature to mail body public
- Public Member Functions inherited from ilMail
 ilMail ($a_user_id)
 Constructor setup an mail object public.
 doesRecipientStillExists ($a_recipient, $a_existing_recipients)
 enableSOAP ($a_status)
 isSOAPEnabled ()
 setSaveInSentbox ($a_save_in_sentbox)
 getSaveInSentbox ()
 setMailSendType ($a_types)
 setMailRcpTo ($a_rcp_to)
 setMailRcpCc ($a_rcp_cc)
 setMailRcpBc ($a_rcp_bc)
 setMailSubject ($a_subject)
 setMailMessage ($a_message)
 readMailObjectReferenceId ()
 read and set mail object id private
 getMailObjectReferenceId ()
 formatNamesForOutput ($users= '')
 Prepends the fullname of each ILIAS login name (is user has a public profile) found in the passed string and brackets the ILIAS login name afterwards.
 getPreviousMail ($a_mail_id)
 getNextMail ($a_mail_id)
 getMailsOfFolder ($a_folder_id, $filter=array())
 get all mails of a specific folder public
 countMailsOfFolder ($a_folder_id)
 count all mails of a specific folder public
 deleteMailsOfFolder ($a_folder_id)
 delete all mails of a specific folder public
 getMailCounterData ()
 get mail counter data returns data array with indexes "total","read","unread" public
 getMail ($a_mail_id)
 get data of one mail public
 markRead ($a_mail_ids)
 mark mails as read public
 markUnread ($a_mail_ids)
 mark mails as unread public
 moveMailsToFolder ($a_mail_ids, $a_folder_id)
 move mail to folder public
 deleteMails ($a_mail_ids)
 delete mail public
 fetchMailData ($a_row)
 fetch all query data from table mail public
 updateDraft ($a_folder_id, $a_attachments, $a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_m_type, $a_m_email, $a_m_subject, $a_m_message, $a_draft_id=0, $a_use_placeholders=0)
 sendInternalMail ($a_folder_id, $a_sender_id, $a_attachments, $a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_status, $a_m_type, $a_m_email, $a_m_subject, $a_m_message, $a_user_id=0, $a_use_placeholders=0)
 save mail in folder private
 replacePlaceholders ($a_message, $a_user_id)
 distributeMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_subject, $a_message, $a_attachments, $sent_mail_id, $a_type, $a_action, $a_use_placeholders=0)
 send internal message to recipients private
 getUserIds ($a_recipients)
 get user_ids
 checkMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_m_subject, $a_m_message, $a_type)
 check if mail is complete, recipients are valid public
 getEmailsOfRecipients ($a_rcp)
 get email addresses of recipients public
 checkRecipients ($a_recipients, $a_type)
 check if recipients are valid public
 savePostData ($a_user_id, $a_attachments, $a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_m_type, $a_m_email, $a_m_subject, $a_m_message, $a_use_placeholders)
 save post data in table public
 getSavedData ()
 get saved data public
 sendMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bc, $a_m_subject, $a_m_message, $a_attachment, $a_type, $a_use_placeholders=0)
 send external mail using class.ilMimeMail.php
 parseRcptOfMailingLists ($rcpt= '')
 saveInSentbox ($a_attachment, $a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_type, $a_m_subject, $a_m_message)
 send mime mail using class.ilMimeMail.php
 addFullname ($a_email)
 add user fullname to mail 'From'
 getMimeMailSender ()
 Returns the sender of the mime mail.
 sendMimeMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_m_subject, $a_m_message, $a_attachments)
 send mime mail using class.ilMimeMail.php All external mails are send to SOAP::sendMail starting a kind of background process
 getEmailOfSender ()
 get email of sender public
 saveAttachments ($a_attachments)
 set attachments
 getAttachments ()
 get attachments public
 explodeRecipients ($a_recipients, $use_pear=true)
 explode recipient string allowed seperators are ',' ';' ' '
 __getCountRecipient ($rcp, $a_only_email=true)
 __getCountRecipients ($a_to, $a_cc, $a_bcc, $a_only_email=true)
 __getEmailRecipients ($a_rcp)
 __prependMessage ($a_m_message, $rcp_to, $rcp_cc)
 __checkSystemRecipients (&$a_rcp_to)
 __substituteRecipients ($a_rcp, $direction)
 Note: This function can only be used, when ILIAS is configured to not use standards compliant mail addresses.
 appendInstallationSignature ($a_flag=null)
 Setter/Getter for appending the installation signarue.

Additional Inherited Members

- Static Public Member Functions inherited from ilMail
static getIliasMailerAddress ()
 Builds an email address used for system notifications.
static _getUserInternalMailboxAddress ($usr_id, $login=null, $firstname=null, $lastname=null)
 STATIC METHOD.
static _usePearMail ()
 STATIC METHOD.
static _getAutoGeneratedMessageString ($lang=null)
 get auto generated info string
static _getIliasMailerName ()
 Get the name used for mails sent by the anonymous user.
static _getInstallationSignature ()
 Static getter for the installation signature.
static getSubjectPrefix ()
 Get text that will be prepended to auto generated mails.
static getSalutation ($a_usr_id, $a_language=null)
 Get salutation.
- Data Fields inherited from ilMail
 $ilias
 $lng
 $mfile
 $mail_options
 $user_id
 $table_mail
 $table_mail_saved
 $mail_counter
 $mail_data
 $mail_obj_ref_id
 $mail_send_type
 $save_in_sentbox
 $mail_rcp_to
 $mail_rcp_cc
 $mail_rcp_bc
 $mail_subject
 $mail_message
 $mail_use_placeholders = 0
 $soap_enabled = true
 $mail_to_global_roles = 0
- Protected Attributes inherited from ilMail
 $mlists = null
 $appendInstallationSignature = false

Detailed Description

Class UserMail this class handles user mails.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilFormatMail.php 25784 2010-09-28 10:23:24Z hschottm

Definition at line 36 of file class.ilFormatMail.php.

Member Function Documentation

ilFormatMail::appendSearchResult (   $a_names,
  $a_type 
)

append search result to recipient public

Parameters
arraynames to append
stringrcp type ('to','cc','bc')
Returns
string

Definition at line 158 of file class.ilFormatMail.php.

References ilMail\$mail_data.

{
if(empty($this->mail_data))
{
return false;
}
$name_str = implode(',',$a_names);
switch($a_type)
{
case 'to':
$this->mail_data["rcp_to"] = trim($this->mail_data["rcp_to"]);
if($this->mail_data["rcp_to"])
{
$this->mail_data["rcp_to"] = $this->mail_data["rcp_to"].",";
}
$this->mail_data["rcp_to"] = $this->mail_data["rcp_to"] . $name_str;
break;
case 'cc':
$this->mail_data["rcp_cc"] = trim($this->mail_data["rcp_cc"]);
if($this->mail_data["rcp_cc"])
{
$this->mail_data["rcp_cc"] = $this->mail_data["rcp_cc"].",";
}
$this->mail_data["rcp_cc"] = $this->mail_data["rcp_cc"] . $name_str;
break;
case 'bc':
$this->mail_data["rcp_bcc"] = trim($this->mail_data["rcp_bcc"]);
if($this->mail_data["rcp_bcc"])
{
$this->mail_data["rcp_bcc"] = $this->mail_data["rcp_bcc"].",";
}
$this->mail_data["rcp_bcc"] = $this->mail_data["rcp_bcc"] . $name_str;
break;
}
}
ilFormatMail::appendSignature ( )

append signature to mail body public

Returns
string

Definition at line 234 of file class.ilFormatMail.php.

{
return $this->mail_data["m_message"] .= chr(13).chr(10).$this->mail_options->getSignature();
}
ilFormatMail::formatForwardSubject ( )

format a forward subject public

Returns
string

Definition at line 142 of file class.ilFormatMail.php.

{
if(empty($this->mail_data))
{
return false;
}
return $this->mail_data["m_subject"] = "[FWD: ".$this->mail_data["m_subject"]."]";
}
ilFormatMail::formatLinebreakMessage (   $a_message)

format message according to linebreak option

Parameters
stringmessage public
Returns
string formatted message

Definition at line 203 of file class.ilFormatMail.php.

{
$formatted = array();
# debug($a_message);
$linebreak = $this->mail_options->getLinebreak();
// SPLIT INTO LINES returns always an array
$lines = explode(chr(10),$a_message);
for($i=0;$i<count($lines);$i++)
{
if(substr($lines[$i],0,1) != '>')
{
$formatted[] = wordwrap($lines[$i],$linebreak,chr(10));
}
else
{
$formatted[] = $lines[$i];
}
}
$formatted = implode(chr(10),$formatted);
# debug($formatted);
return $formatted;
}
ilFormatMail::formatReplyMessage ( )

format a reply message public

Returns
string

Definition at line 55 of file class.ilFormatMail.php.

{
if(empty($this->mail_data))
{
return false;
}
# debug($this->mail_data["m_message"]);
$bodylines = explode(chr(13).chr(10), $this->mail_data["m_message"]);
# var_dump("<pre>",$bodylines,"</pre");
for ($i = 0; $i < count($bodylines); $i++)
{
$bodylines[$i] = "> ".$bodylines[$i];
}
return $this->mail_data["m_message"] = implode(chr(13).chr(10), $bodylines);
}
ilFormatMail::formatReplyRecipient ( )

get reply recipient public

Returns
string

Definition at line 125 of file class.ilFormatMail.php.

{
if(empty($this->mail_data))
{
return false;
}
require_once './Services/User/classes/class.ilObjUser.php';
$user = new ilObjUser($this->mail_data["sender_id"]);
return $this->mail_data["rcp_to"] = $user->getLogin();
}
ilFormatMail::formatReplyRecipientsForCC ( )

get reply recipients for cc public

Returns
string

Definition at line 90 of file class.ilFormatMail.php.

{
global $ilUser;
if(empty($this->mail_data))
{
return '';
}
$newCC = array();
foreach (explode(',', $this->mail_data['rcp_to']) as $to)
{
if (trim($to) != '' && $ilUser->getLogin() != trim($to))
{
$newCC[] = trim($to);
}
}
foreach (explode(',', $this->mail_data['rcp_cc']) as $cc)
{
if (trim($cc) != '' && $ilUser->getLogin() != trim($cc))
{
$newCC[] = trim($cc);
}
}
return ($this->mail_data['rcp_cc'] = implode(', ', $newCC));
}
ilFormatMail::formatReplySubject ( )

format a reply subject public

Returns
string

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

{
if(empty($this->mail_data))
{
return false;
}
return $this->mail_data["m_subject"] = "RE: ".$this->mail_data["m_subject"];
}
ilFormatMail::ilFormatMail (   $a_user_id)

Constructor setup an mail object.

Parameters
intuser_id public

Definition at line 45 of file class.ilFormatMail.php.

References ilMail\ilMail().

{
parent::ilMail($a_user_id);
}

+ Here is the call graph for this function:


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