ILIAS  Release_5_0_x_branch Revision 61816
 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

 __construct ($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
 prependSignature ()
- Public Member Functions inherited from ilMail
 __get ($name)
 Magic interceptor method __get Used to include files / instantiate objects at runtime.
 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= '', $maintain_lists=false)
 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
 sendMimeMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_m_subject, $a_m_message, $a_attachments, $a_no_soap=false)
 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 addFullname ($a_email, $a_fullname)
static getIliasMailerAddress ()
 Builds an email address used for system notifications.
static _getUserInternalMailboxAddress ($usr_id, $login=null, $firstname=null, $lastname=null)
 STATIC METHOD.
static _getAutoGeneratedMessageString ($lang=null)
 get auto generated info string
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
const ILIAS_HOST = 'ilias'
- Static Protected Member Functions inherited from ilMail
static getCachedUserInstance ($a_usr_id)
 Returns a cached instance of ilObjUser.
- Protected Attributes inherited from ilMail
 $appendInstallationSignature = false
 $properties = array()
- Static Protected Attributes inherited from ilMail
static $userInstances = array()

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 40972 2013-03-28 10:26:52Z mjansen

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

Constructor & Destructor Documentation

ilFormatMail::__construct (   $a_user_id)

Constructor setup an mail object.

Parameters
intuser_id public

Reimplemented from ilMail.

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

{
parent::__construct($a_user_id);
}

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 137 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 213 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 121 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 182 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 34 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 104 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 69 of file class.ilFormatMail.php.

References $ilUser.

{
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 55 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::prependSignature ( )
Returns
string

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

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

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