ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
This class handles base functions for mail handling. More...
Public Member Functions | |
__construct ( $a_user_id, ilMailAddressTypeFactory $mailAddressTypeFactory=null, ilMailRfc822AddressParserFactory $mailAddressParserFactory=null) | |
__get ($name) | |
Magic interceptor method __get Used to include files / instantiate objects at runtime. More... | |
existsRecipient ($a_recipient, $a_existing_recipients) | |
enableSOAP ($a_status) | |
Define if external mails should be sent using SOAP client or not. More... | |
isSOAPEnabled () | |
setSaveInSentbox ($a_save_in_sentbox) | |
getSaveInSentbox () | |
getMailObjectReferenceId () | |
formatNamesForOutput ($a_recipients) | |
Prepends the fullname of each ILIAS login name (if user has a public profile) found in the passed string and brackets the ILIAS login name afterwards. More... | |
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 () | |
sendMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bc, $a_m_subject, $a_m_message, $a_attachment, $a_type, $a_use_placeholders=0) | |
Should be used to send notifcations over the internal or external mail channel. More... | |
validateRecipients ($a_rcp_to, $a_rcp_cc, $a_rcp_bc) | |
saveAttachments ($a_attachments) | |
appendInstallationSignature ($a_flag=null) | |
Setter/Getter for appending the installation signarue. More... | |
formatLinebreakMessage ($a_message) | |
Static Public Member Functions | |
static | _getAutoGeneratedMessageString (ilLanguage $lang=null) |
Get auto generated info string. More... | |
static | _getInstallationSignature () |
static | getSubjectPrefix () |
Get text that will be prepended to auto generated mails. More... | |
static | getSalutation ($a_usr_id, ilLanguage $a_language=null) |
Data Fields | |
const | ILIAS_HOST = 'ilias' |
const | MAIL_SUBJECT_PREFIX = '[ILIAS]' |
$user_id | |
Protected Member Functions | |
isSystemMail () | |
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 (array $a_recipients) | |
checkMail ($a_rcp_to, $a_rcp_cc, $a_rcp_bcc, $a_m_subject) | |
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() |
Private Attributes | |
$mailAddressTypeFactory | |
$mailAddressParserFactory | |
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::__construct | ( | $a_user_id, | |
ilMailAddressTypeFactory | $mailAddressTypeFactory = null , |
||
ilMailRfc822AddressParserFactory | $mailAddressParserFactory = null |
||
) |
integer | $a_user_id | |
ilMailAddressTypeFactory | null | $mailAddressTypeFactory | |
ilMailRfc822AddressParserFactory | null | $mailAddressParserFactory |
Definition at line 127 of file class.ilMail.php.
References $DIC, $mailAddressParserFactory, $mailAddressTypeFactory, readMailObjectReferenceId(), and setSaveInSentbox().
ilMail::__get | ( | $name | ) |
Magic interceptor method __get Used to include files / instantiate objects at runtime.
string | $name | The name of the class property |
Definition at line 179 of file class.ilMail.php.
References $DIC, $name, and properties.
|
static |
Get auto generated info string.
ilLanguage | $lang |
Definition at line 1613 of file class.ilMail.php.
References $DIC, $GLOBALS, $lang, ilUtil\_getHttpPath(), and ilLanguageFactory\_getLanguage().
Referenced by ilMailSummaryNotification\__construct(), ilECSAppEventListener\_sendNotification(), ilSystemNotification\compose(), ilECSObjectSettings\sendNewContentNotification(), ilRemoteObjectBase\sendNewContentNotification(), and ilAuthContainerECS\sendNotification().
|
static |
Definition at line 1661 of file class.ilMail.php.
References $DIC, and ilUtil\_getHttpPath().
Referenced by ilRegistrationMimeMailNotification\__construct(), ilMailSummaryNotification\__construct(), ilSystemNotification\compose(), ilCronDeleteInactiveUserReminderMailNotification\send(), ilMailCronOrphanedMailsNotification\send(), ilForumMailNotification\send(), ilAccountRegistrationMail\sendLanguageVariableBasedAccountMail(), and ilObjSurveyGUI\sendUserResultsMail().
ilMail::appendInstallationSignature | ( | $a_flag = null | ) |
Setter/Getter for appending the installation signarue.
mixed | boolean or nothing |
Definition at line 1648 of file class.ilMail.php.
References $appendInstallationSignature.
Referenced by sendMail().
|
protected |
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bcc | |
string | $a_m_subject |
Definition at line 1104 of file class.ilMail.php.
References $errors, and array.
Referenced by sendMail().
|
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 1126 of file class.ilMail.php.
References $errors, array, and parseAddresses().
Referenced by validateRecipients().
ilMail::countMailsOfFolder | ( | $a_folder_id | ) |
ilMail::deleteMails | ( | array | $a_mail_ids | ) |
array | $a_mail_ids |
Definition at line 570 of file class.ilMail.php.
Referenced by deleteMailsOfFolder(), and sendMail().
ilMail::deleteMailsOfFolder | ( | $a_folder_id | ) |
int | $a_folder_id | id of folder |
Definition at line 424 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 811 of file class.ilMail.php.
References $a_type, $email, $id, array, formatLinebreakMessage(), ilMailOptions\getExternalEmailsByUser(), ilLoggerFactory\getLogger(), getUserIds(), ilMailOptions\INCOMING_BOTH, ilMailOptions\INCOMING_EMAIL, replacePlaceholders(), and sendInternalMail().
Referenced by sendMail().
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 228 of file class.ilMail.php.
ilMail::existsRecipient | ( | $a_recipient, | |
$a_existing_recipients | |||
) |
string | $a_recipient | |
string | $a_existing_recipients |
Definition at line 201 of file class.ilMail.php.
References parseAddresses().
|
protected |
array|null |
Definition at line 590 of file class.ilMail.php.
References array.
Referenced by getMail(), getMailsOfFolder(), getNextMail(), getPreviousMail(), and getSavedData().
ilMail::formatLinebreakMessage | ( | $a_message | ) |
Definition at line 1744 of file class.ilMail.php.
Referenced by distributeMail(), sendInternalMail(), and sendMail().
ilMail::formatNamesForOutput | ( | $a_recipients | ) |
Prepends the fullname of each ILIAS login name (if user has a public profile) found in the passed string and brackets the ILIAS login name afterwards.
string | $a_recipients | A string containing to, cc or bcc recipients |
Definition at line 290 of file class.ilMail.php.
References $DIC, $names, ilObjUser\_lookupId(), ilObjUser\_lookupPref(), and array.
|
staticprotected |
int | $a_usr_id |
Definition at line 1731 of file class.ilMail.php.
|
protected |
string | $a_recipients | |
bool | $a_only_email |
Definition at line 1544 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 1577 of file class.ilMail.php.
References getCountRecipient().
Referenced by sendMail().
|
protected |
string | $a_recipients |
Definition at line 1589 of file class.ilMail.php.
References ilObjUser\_lookupId(), array, and parseAddresses().
Referenced by sendMail().
ilMail::getMail | ( | $a_mail_id | ) |
int | $a_mail_id |
Definition at line 442 of file class.ilMail.php.
References $mail_data, $res, array, and fetchMailData().
ilMail::getMailObjectReferenceId | ( | ) |
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 370 of file class.ilMail.php.
References $output, $query, $res, $row, array, and fetchMailData().
Referenced by deleteMailsOfFolder(), ilPDSysMessageBlockGUI\getMails(), and ilPDMailBlockGUI\getMails().
ilMail::getNewDraftId | ( | $usrId, | |
$folderId | |||
) |
int | $usrId | |
int | $folderId |
Definition at line 608 of file class.ilMail.php.
References array.
ilMail::getNextMail | ( | $a_mail_id | ) |
int | $a_mail_id |
Definition at line 346 of file class.ilMail.php.
References $mail_data, $res, array, and fetchMailData().
ilMail::getPreviousMail | ( | $a_mail_id | ) |
int | $a_mail_id |
Definition at line 323 of file class.ilMail.php.
References $mail_data, $res, array, and fetchMailData().
|
static |
int | $a_usr_id | |
$a_language | ilLanguage|null |
Definition at line 1705 of file class.ilMail.php.
References $DIC, $lang, $name, ilObjUser\_lookupGender(), and ilObjUser\_lookupName().
Referenced by ilMailSummaryNotification\__construct(), ilTestManScoringParticipantNotification\buildBody(), ilSystemNotification\compose(), ilChatroom\isOwnerOfPrivateRoom(), ilRegistrationMailNotification\send(), ilMailCronOrphanedMailsNotification\send(), ilDiskQuotaSummaryNotification\send(), ilSessionMembershipMailNotification\send(), ilBuddySystemNotification\send(), ilIndividualAssessmentPrimitiveInternalNotificator\send(), ilLMMailNotification\send(), ilExerciseMailNotification\send(), ilCourseMembershipMailNotification\send(), ilGroupMembershipMailNotification\send(), ilCalendarMailNotification\send(), ilForumMailNotification\send(), ilTestMailNotification\sendAdvancedNotification(), ilTestMailNotification\sendSimpleNotification(), and ilObjSurveyGUI\sendUserResultsMail().
ilMail::getSavedData | ( | ) |
Definition at line 1230 of file class.ilMail.php.
References $mail_data, $res, array, and fetchMailData().
Referenced by ilObjUserFolderGUI\mailObject(), and savePostData().
ilMail::getSaveInSentbox | ( | ) |
Definition at line 262 of file class.ilMail.php.
References $save_in_sentbox.
Referenced by sendMail().
|
static |
Get text that will be prepended to auto generated mails.
Definition at line 1688 of file class.ilMail.php.
References $DIC.
Referenced by ilMimeMail\Subject().
|
protected |
string[] | $a_recipients |
Definition at line 1082 of file class.ilMail.php.
References array, and parseAddresses().
Referenced by distributeMail().
ilMail::isSOAPEnabled | ( | ) |
Definition at line 236 of file class.ilMail.php.
References $DIC, $soap_enabled, ilContext\CONTEXT_CRON, and ilContext\getType().
Referenced by saveInSentbox().
|
protected |
Definition at line 168 of file class.ilMail.php.
Referenced by sendMail().
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 1515 of file class.ilMail.php.
References $parser, ilMailAddress\getHost(), ilLoggerFactory\getLogger(), and ilMailAddress\getMailbox().
Referenced by checkRecipients(), existsRecipient(), getCountRecipient(), getEmailRecipients(), and getUserIds().
|
protected |
Read and set the mail object ref id (administration node)
Definition at line 270 of file class.ilMail.php.
References ilMailGlobalServices\getMailObjectRefId().
Referenced by __construct().
|
protected |
string | $a_message | |
int | $a_user_id | |
boolean | $replace_empty |
Definition at line 772 of file class.ilMail.php.
References ilMailFormCall\getContextId(), ilMailFormCall\getContextParameters(), ilLoggerFactory\getLogger(), and ilMailTemplateService\getTemplateContextById().
Referenced by distributeMail(), sendInternalMail(), and sendMail().
ilMail::saveAttachments | ( | $a_attachments | ) |
array | $a_attachments | An array of attachments |
Definition at line 1494 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 | |
array | $a_type | |
string | $a_m_subject | |
string | $a_m_message |
Definition at line 1390 of file class.ilMail.php.
References $_COOKIE, $a_type, $GLOBALS, array, isSOAPEnabled(), and sendInternalMail().
Referenced by sendMail().
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 1163 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 | |
array | $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 682 of file class.ilMail.php.
References $user_id, array, date, formatLinebreakMessage(), replacePlaceholders(), and time.
Referenced by distributeMail(), and saveInSentbox().
ilMail::sendMail | ( | $a_rcp_to, | |
$a_rcp_cc, | |||
$a_rcp_bc, | |||
$a_m_subject, | |||
$a_m_message, | |||
$a_attachment, | |||
$a_type, | |||
$a_use_placeholders = 0 |
|||
) |
Should be used to send notifcations over the internal or external mail channel.
string | $a_rcp_to | |
string | $a_rcp_cc | |
string | $a_rcp_bc | |
string | $a_m_subject | |
string | $a_m_message | |
array | $a_attachment | |
array | $a_type | (normal and/or system and/or email) |
bool | int | $a_use_placeholders |
Definition at line 1255 of file class.ilMail.php.
References $a_type, $DIC, $errors, appendInstallationSignature(), array, checkMail(), deleteMails(), distributeMail(), formatLinebreakMessage(), getCountRecipients(), getEmailRecipients(), ilLoggerFactory\getLogger(), getSaveInSentbox(), isSystemMail(), replacePlaceholders(), saveInSentbox(), and validateRecipients().
ilMail::setSaveInSentbox | ( | $a_save_in_sentbox | ) |
bool | $a_save_in_sentbox |
Definition at line 254 of file class.ilMail.php.
Referenced by __construct(), and 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 621 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 1361 of file class.ilMail.php.
References $errors, array, and checkRecipients().
Referenced by sendMail().
|
protected |
Definition at line 105 of file class.ilMail.php.
Referenced by appendInstallationSignature().
|
protected |
Definition at line 77 of file class.ilMail.php.
|
protected |
Definition at line 74 of file class.ilMail.php.
|
protected |
Definition at line 95 of file class.ilMail.php.
Referenced by ilFormatMail\appendSearchResult(), deleteMailsOfFolder(), getMail(), getNextMail(), getPreviousMail(), and getSavedData().
|
protected |
Definition at line 98 of file class.ilMail.php.
Referenced by getMailObjectReferenceId().
|
protected |
Definition at line 83 of file class.ilMail.php.
|
protected |
Definition at line 104 of file class.ilMail.php.
|
private |
Definition at line 120 of file class.ilMail.php.
Referenced by __construct().
|
private |
Definition at line 117 of file class.ilMail.php.
Referenced by __construct().
|
protected |
Definition at line 80 of file class.ilMail.php.
|
protected |
Definition at line 111 of file class.ilMail.php.
|
protected |
Definition at line 101 of file class.ilMail.php.
Referenced by getSaveInSentbox().
|
protected |
Definition at line 103 of file class.ilMail.php.
Referenced by isSOAPEnabled().
|
protected |
Definition at line 89 of file class.ilMail.php.
|
protected |
Definition at line 92 of file class.ilMail.php.
ilMail::$user_id |
Definition at line 86 of file class.ilMail.php.
Referenced by sendInternalMail().
|
staticprotected |
Definition at line 114 of file class.ilMail.php.
const ilMail::ILIAS_HOST = 'ilias' |
Definition at line 69 of file class.ilMail.php.
Referenced by ilMailAddressTypeFactory\__construct(), ilUtil\is_email(), ilMailLoginOrEmailAddressAddressType\isValid(), ilMailPearRfc822WrapperAddressParser\parseAddressString(), ilMailImapRfc822AddressParser\parseAddressString(), ilMailLoginOrEmailAddressAddressType\resolve(), and ilMailRoleAddressType\searchRolesByMailboxAddressList().
const ilMail::MAIL_SUBJECT_PREFIX = '[ILIAS]' |
Definition at line 71 of file class.ilMail.php.
Referenced by ilObjMailGUI\populateExternalSettingsForm().