ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
This class handles base functions for mail handling. More...
Public Member Functions | |
existsRecipient ($a_recipient, $a_existing_recipients) | |
enableSOAP ($a_status) | |
Define if external mails should be sent using SOAP client or not. More... | |
setSaveInSentbox ($a_save_in_sentbox) | |
getSaveInSentbox () | |
getMailObjectReferenceId () | |
getPreviousMail ($a_mail_id) | |
getNextMail ($a_mail_id) | |
getMailsOfFolder ($a_folder_id, $filter=array()) | |
countMailsOfFolder ($a_folder_id) | |
deleteMailsOfFolder ($a_folder_id) | |
getMail ($a_mail_id) | |
markRead (array $a_mail_ids) | |
markUnread (array $a_mail_ids) | |
moveMailsToFolder (array $a_mail_ids, $a_folder_id) | |
deleteMails (array $a_mail_ids) | |
getNewDraftId ($usrId, $folderId) | |
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, $a_tpl_context_id=null, $a_tpl_context_params=array()) | |
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, $a_tpl_context_id=null, $a_tpl_context_params=array()) | |
save mail in folder private More... | |
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, $a_tpl_context_id=null, $a_tpl_ctx_params=array()) | |
save post data in table public More... | |
getSavedData () | |
validateRecipients ($a_rcp_to, $a_rcp_cc, $a_rcp_bc) | |
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. More... | |
saveAttachments ($a_attachments) | |
appendInstallationSignature ($a_flag=null) | |
Setter/Getter for appending the installation signarue. More... | |
Data Fields | |
const | ILIAS_HOST = 'ilias' |
$user_id | |
Protected Member Functions | |
readMailObjectReferenceId () | |
Read and set the mail object ref id (administration node) More... | |
fetchMailData ($a_row) | |
replacePlaceholders ($a_message, $a_user_id=0, $replace_empty=true) | |
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) | |
getUserIds ($a_recipients) | |
checkMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_m_subject, $a_m_message, $a_type) | |
checkRecipients ($a_recipients) | |
Check if recipients are valid. More... | |
saveInSentbox ($a_attachment, $a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_type, $a_m_subject, $a_m_message) | |
Stores a message in the sent bod of the current user. More... | |
parseAddresses ($addresses) | |
Explode recipient string, allowed separators are ',' ';' ' ' Returns an array with recipient ilMailAddress instances. More... | |
getCountRecipient ($a_recipients, $a_only_email=true) | |
getCountRecipients ($a_to, $a_cc, $a_bcc, $a_only_email=true) | |
getEmailRecipients ($a_recipients) | |
Static Protected Member Functions | |
static | getCachedUserInstance ($a_usr_id) |
Protected Attributes | |
$lng | |
$db | |
$mfile | |
$mail_options | |
$table_mail | |
$table_mail_saved | |
$mail_data = array() | |
$mail_obj_ref_id | |
$save_in_sentbox | |
$soap_enabled = true | |
$mail_to_global_roles = 0 | |
$appendInstallationSignature = false | |
$properties = array() | |
Static Protected Attributes | |
static | $userInstances = array() |
This class handles base functions for mail handling.
ILIAS is enabled to use standards compliant email addresses. The class supports RFC 822 compliant address lists as specified in http://www.ietf.org/rfc/rfc0822.txt
Examples: The following mailbox addresses work for sending an email to the user with the login john.doe and email address jd@ma. The user is member of the course "French Course". The member role of the course object has the name "il_crs_member_998" and the object ID "1000". il.c om
john.doe John Doe <john.doe> john.doe #member@[French Course] #il_crs_member_998 #il_role_1000 jd@ma John Doe il.c omjd@ma il.c om
Syntax Rules: The following excerpt from chapter 6.1 "Syntax" of RFC 822 is relevant for the semantics described below:
addr-spec = local-part [ "@", domain ]
Semantics: User account mailbox address:
Role object mailbox address:
External Email address:
Definition at line 66 of file class.ilMail.php.
ilMail::appendInstallationSignature | ( | $a_flag = null | ) |
Setter/Getter for appending the installation signarue.
mixed | boolean or nothing |
Definition at line 1629 of file class.ilMail.php.
References $appendInstallationSignature, $ilSetting, $lang, $lng, ilUtil\_getHttpPath(), ilObjUser\_lookupGender(), and ilObjUser\_lookupName().
Referenced by getSavedData().
|
protected |
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bcc | |
string | $a_m_subject | |
string | $a_m_message | |
string | $a_type |
Definition at line 989 of file class.ilMail.php.
References $errors, and array.
Referenced by getSavedData().
|
protected |
Check if recipients are valid.
string | $a_recipients | string with login names or group names (start with #) |
string | $a_type |
ilMailException |
Definition at line 1013 of file class.ilMail.php.
References $errors, array, ilMailAddressTypeFactory\getByPrefix(), and parseAddresses().
Referenced by validateRecipients().
ilMail::countMailsOfFolder | ( | $a_folder_id | ) |
ilMail::deleteMails | ( | array | $a_mail_ids | ) |
array | $a_mail_ids |
Definition at line 561 of file class.ilMail.php.
References array.
Referenced by deleteMailsOfFolder(), and getSavedData().
ilMail::deleteMailsOfFolder | ( | $a_folder_id | ) |
int | $a_folder_id | id of folder |
Definition at line 415 of file class.ilMail.php.
References $mail_data, array, deleteMails(), and getMailsOfFolder().
|
protected |
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bcc | |
string | $a_subject | |
string | $a_message | |
array | $a_attachments | |
integer | $sent_mail_id | |
array | $a_type | |
array | $a_action | |
array | int | $a_use_placeholders |
Definition at line 764 of file class.ilMail.php.
References $a_type, array, ilLoggerFactory\getLogger(), getUserIds(), replacePlaceholders(), sendInternalMail(), and sendMimeMail().
Referenced by getSavedData().
ilMail::enableSOAP | ( | $a_status | ) |
Define if external mails should be sent using SOAP client or not.
The autogenerated mails in new user registration sets this value to false, since there is no valid session.
bool | $a_status |
Definition at line 213 of file class.ilMail.php.
References $ilSetting, $soap_enabled, ilContext\CONTEXT_CRON, and ilContext\getType().
ilMail::existsRecipient | ( | $a_recipient, | |
$a_existing_recipients | |||
) |
string | $a_recipient | |
string | $a_existing_recipients |
Definition at line 177 of file class.ilMail.php.
References parseAddresses().
|
protected |
array|null |
Definition at line 581 of file class.ilMail.php.
References array.
Referenced by getMail(), getMailsOfFolder(), getNextMail(), getPreviousMail(), and getSavedData().
|
staticprotected |
int | $a_usr_id |
Definition at line 1714 of file class.ilMail.php.
|
protected |
string | $a_recipients | |
bool | $a_only_email |
Definition at line 1501 of file class.ilMail.php.
References $counter, ilObjUser\_lookupId(), and parseAddresses().
Referenced by getCountRecipients().
|
protected |
string | $a_to | |
string | $a_cc | |
string | $a_bcc | |
bool | $a_only_email |
Definition at line 1540 of file class.ilMail.php.
References getCountRecipient().
Referenced by getSavedData().
|
protected |
string | $a_recipients |
Definition at line 1552 of file class.ilMail.php.
References $ilSetting, $lang, ilUtil\_getHttpPath(), ilLanguageFactory\_getLanguage(), ilObjUser\_lookupId(), array, and parseAddresses().
Referenced by getSavedData().
ilMail::getMail | ( | $a_mail_id | ) |
int | $a_mail_id |
Definition at line 435 of file class.ilMail.php.
References $mail_data, $res, array, and fetchMailData().
ilMail::getMailObjectReferenceId | ( | ) |
Definition at line 267 of file class.ilMail.php.
References $ilUser, $mail_obj_ref_id, $names, ilObjUser\_lookupId(), ilObjUser\_lookupPref(), and array.
ilMail::getMailsOfFolder | ( | $a_folder_id, | |
$filter = array() |
|||
) |
int | $a_folder_id | The id of the folder |
array | $filter | An optional filter array |
Definition at line 361 of file class.ilMail.php.
References $output, $query, $res, $row, array, and fetchMailData().
Referenced by deleteMailsOfFolder(), and ilPDMailBlockGUI\getMails().
ilMail::getNewDraftId | ( | $usrId, | |
$folderId | |||
) |
int | $usrId | |
int | $folderId |
Definition at line 600 of file class.ilMail.php.
References array.
ilMail::getNextMail | ( | $a_mail_id | ) |
int | $a_mail_id |
Definition at line 338 of file class.ilMail.php.
References $mail_data, $res, array, and fetchMailData().
ilMail::getPreviousMail | ( | $a_mail_id | ) |
int | $a_mail_id |
Definition at line 316 of file class.ilMail.php.
References $mail_data, $res, array, and fetchMailData().
ilMail::getSavedData | ( | ) |
Definition at line 1099 of file class.ilMail.php.
References $a_type, $errors, $mail_data, $res, appendInstallationSignature(), array, checkMail(), deleteMails(), distributeMail(), fetchMailData(), getCountRecipients(), getEmailRecipients(), ilLoggerFactory\getLogger(), getSaveInSentbox(), replacePlaceholders(), saveInSentbox(), sendMimeMail(), and validateRecipients().
Referenced by ilObjUserFolderGUI\mailObject(), and savePostData().
ilMail::getSaveInSentbox | ( | ) |
Definition at line 250 of file class.ilMail.php.
References $save_in_sentbox.
Referenced by getSavedData().
|
protected |
string | $a_recipients | recipients seperated by ',' |
Definition at line 965 of file class.ilMail.php.
References array, ilMailAddressTypeFactory\getByPrefix(), and parseAddresses().
Referenced by distributeMail().
ilMail::markRead | ( | array | $a_mail_ids | ) |
ilMail::markUnread | ( | array | $a_mail_ids | ) |
ilMail::moveMailsToFolder | ( | array | $a_mail_ids, |
$a_folder_id | |||
) |
|
protected |
Explode recipient string, allowed separators are ',' ';' ' ' Returns an array with recipient ilMailAddress instances.
string | $addresses |
Definition at line 1471 of file class.ilMail.php.
References $parser, ilMailAddress\getHost(), ilLoggerFactory\getLogger(), ilMailAddress\getMailbox(), and ilMailRfc822AddressParserFactory\getParser().
Referenced by checkRecipients(), existsRecipient(), getCountRecipient(), getEmailRecipients(), and getUserIds().
|
protected |
Read and set the mail object ref id (administration node)
Definition at line 258 of file class.ilMail.php.
References ilMailGlobalServices\getMailObjectRefId().
|
protected |
string | $a_message | |
int | $a_user_id | |
boolean | $replace_empty |
Definition at line 719 of file class.ilMail.php.
References ilMailFormCall\getContextId(), ilMailFormCall\getContextParameters(), ilLoggerFactory\getLogger(), and ilMailTemplateService\getTemplateContextById().
Referenced by distributeMail(), getSavedData(), and sendInternalMail().
ilMail::saveAttachments | ( | $a_attachments | ) |
array | $a_attachments | An array of attachments |
Definition at line 1451 of file class.ilMail.php.
References array.
|
protected |
Stores a message in the sent bod of the current user.
array | $a_attachment | |
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bcc | |
string | $a_type | |
string | $a_m_subject | |
string | $a_m_message |
Definition at line 1280 of file class.ilMail.php.
References $_SERVER, $a_type, $ilSetting, $ilUser, $user_id, array, ilUtil\is_email(), and sendInternalMail().
Referenced by getSavedData().
ilMail::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, | |||
$a_tpl_context_id = null , |
|||
$a_tpl_ctx_params = array() |
|||
) |
save post data in table public
int | $a_user_id | |
array | $a_attachments | |
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bcc | |
array | $a_m_type | |
int | $a_m_email | |
string | $a_m_subject | |
string | $a_m_message | |
int | $a_use_placeholders | |
string | null | $a_tpl_context_id | |
array | null | $a_tpl_ctx_params |
Definition at line 1056 of file class.ilMail.php.
References array, and getSavedData().
ilMail::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 , |
|||
$a_tpl_context_id = null , |
|||
$a_tpl_context_params = array() |
|||
) |
save mail in folder private
integer | $a_folder_id | |
integer | $a_sender_id | |
array | $a_attachments | |
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bcc | |
string | $a_status | |
string | $a_m_type | |
integer | $a_m_email | |
string | $a_m_subject | |
string | $a_m_message | |
integer | $a_user_id | |
integer | $a_use_placeholders | |
string | null | $a_tpl_context_id | |
array | null | $a_tpl_context_params |
Definition at line 664 of file class.ilMail.php.
References $user_id, array, date, replacePlaceholders(), and time.
Referenced by distributeMail(), and saveInSentbox().
ilMail::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 (if enabled) starting a kind of background process
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bcc | |
string | $a_m_subject | |
string | $a_m_message | |
array | $a_attachments | |
bool | $a_no_soap |
Definition at line 1369 of file class.ilMail.php.
References $_COOKIE, and array.
Referenced by distributeMail(), and getSavedData().
ilMail::setSaveInSentbox | ( | $a_save_in_sentbox | ) |
bool | $a_save_in_sentbox |
Definition at line 242 of file class.ilMail.php.
Referenced by ilSoapUtils\distributeMails().
ilMail::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 , |
|||
$a_tpl_context_id = null , |
|||
$a_tpl_context_params = array() |
|||
) |
Definition at line 613 of file class.ilMail.php.
References array, date, and time.
ilMail::validateRecipients | ( | $a_rcp_to, | |
$a_rcp_cc, | |||
$a_rcp_bc | |||
) |
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bc |
Definition at line 1247 of file class.ilMail.php.
References $errors, array, and checkRecipients().
Referenced by getSavedData().
|
protected |
Definition at line 103 of file class.ilMail.php.
Referenced by appendInstallationSignature().
|
protected |
Definition at line 75 of file class.ilMail.php.
|
protected |
Definition at line 72 of file class.ilMail.php.
Referenced by appendInstallationSignature().
|
protected |
Definition at line 93 of file class.ilMail.php.
Referenced by ilFormatMail\appendSearchResult(), deleteMailsOfFolder(), getMail(), getNextMail(), getPreviousMail(), and getSavedData().
|
protected |
Definition at line 96 of file class.ilMail.php.
Referenced by getMailObjectReferenceId().
|
protected |
Definition at line 81 of file class.ilMail.php.
|
protected |
Definition at line 102 of file class.ilMail.php.
|
protected |
Definition at line 78 of file class.ilMail.php.
|
protected |
Definition at line 109 of file class.ilMail.php.
|
protected |
Definition at line 99 of file class.ilMail.php.
Referenced by getSaveInSentbox().
|
protected |
Definition at line 101 of file class.ilMail.php.
Referenced by enableSOAP().
|
protected |
Definition at line 87 of file class.ilMail.php.
|
protected |
Definition at line 90 of file class.ilMail.php.
ilMail::$user_id |
Definition at line 84 of file class.ilMail.php.
Referenced by saveInSentbox(), and sendInternalMail().
|
staticprotected |
Definition at line 112 of file class.ilMail.php.
const ilMail::ILIAS_HOST = 'ilias' |
Definition at line 69 of file class.ilMail.php.
Referenced by ilMailAddressTypeFactory\getByPrefix(), ilMailRoleAddressType\getRoleIdsByAddress(), ilUtil\is_email(), ilMailImapRfc822AddressParser\parseAddressString(), ilMailPearRfc822WrapperAddressParser\parseAddressString(), and ilMailLoginOrEmailAddressAddressType\resolve().