本文整理汇总了PHP中ilMail::getSalutation方法的典型用法代码示例。如果您正苦于以下问题:PHP ilMail::getSalutation方法的具体用法?PHP ilMail::getSalutation怎么用?PHP ilMail::getSalutation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilMail
的用法示例。
在下文中一共展示了ilMail::getSalutation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildBody
private function buildBody()
{
// Salutation
$this->setBody(ilMail::getSalutation($this->getRecipient(), $this->getLanguage()));
$this->appendBody("\n\n");
// Message (What has happened?)
$this->appendBody($this->getLanguageText('tst_notify_manscoring_done_body_msg_topic'));
$this->appendBody("\n\n");
$info = $this->getAdditionalInformation();
$this->appendBody($this->getLanguageText('obj_tst') . ': ' . $info['test_title']);
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('pass') . ': ' . $info['test_pass']);
$this->appendBody("\n\n");
foreach ($info['questions_gui_list'] as $questionId => $questionGui) {
$points = $info['questions_scoring_data'][$questionId]['points'];
$feedback = $info['questions_scoring_data'][$questionId]['feedback'];
$feedback = $this->convertFeedbackForMail($feedback);
$this->appendBody($this->getLanguageText('tst_question') . ': ' . $questionGui->object->getTitle());
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('tst_reached_points') . ': ' . $points);
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('set_manual_feedback') . ":\n" . $feedback);
$this->appendBody("\n\n");
}
// Task (What do I have to do?
/* NOTHING TODO FOR PARTICIPANT */
// Explanation (Why do I receive the following message?)
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('tst_notify_manscoring_done_body_msg_reason'));
// Signature
$this->getMail()->appendInstallationSignature(true);
}
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:32,代码来源:class.ilTestManScoringParticipantNotification.php
示例2: sendAdvancedNotification
/**
* send an advanced notification to the owner of the test
* @param int $owner_id
* @param string $title
* @param sting $usr_data
* @param array $file_names
*/
public function sendAdvancedNotification($owner_id, $title, $usr_data, $file_names)
{
$this->initLanguage($owner_id);
$this->language->loadLanguageModule('assessment');
$this->initMail();
$this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
$this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('user_has_finished_a_test'));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('title') . ': ' . $title);
$this->appendBody("\n");
$this->appendBody($this->language->txt('username') . ': ' . $usr_data);
$this->appendBody("\n");
ilDatePresentation::setUseRelativeDates(false);
$this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('tst_attached_xls_file'));
$this->appendBody("\n\n");
$this->appendBody($this->language->txt('tst_notification_explanation_admin'));
$this->appendBody("\n");
$this->setAttachments($file_names);
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($owner_id), array('system'));
}
示例3: send
/**
* Send notifications
* @return
*/
public function send()
{
global $ilUser;
switch ($this->getType()) {
case self::TYPE_USER_BLOCKED:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cont_user_blocked'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cont_user_blocked2'));
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('cont_user_blocked3') . " '" . $this->getLanguageText('objs_qst') . "' > '" . $this->getLanguageText('cont_blocked_users') . "'");
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('obj_lm') . ": " . $this->getObjectTitle(true));
$this->appendBody("\n");
include_once "./Services/User/classes/class.ilUserUtil.php";
$this->appendBody($this->getLanguageText('user') . ": " . ilUserUtil::getNamePresentation($ilUser->getId(), false, false, ""));
$this->appendBody("\n");
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$this->appendBody($this->getLanguageText('question') . ": " . assQuestion::_getTitle($this->getQuestionId()));
$this->appendBody("\n");
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cont_lm_mail_permanent_link'));
$this->appendBody("\n");
$this->appendBody($this->createPermanentLink(array(), ""));
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
}
return true;
}
示例4: send
/**
*
* Send notifications
*
* @access public
*
*/
public function send()
{
global $ilDB;
// parent::send();
if (count($this->getRecipients())) {
$res = $ilDB->queryf("SELECT u.usr_id,u.gender,u.firstname,u.lastname,u.login,u.email,u.last_login,u.active," . "u.time_limit_unlimited, " . $ilDB->fromUnixtime("u.time_limit_from") . ", " . $ilDB->fromUnixtime("u.time_limit_until") . "," . "CASE WHEN u.active = 0 THEN '0001-01-01' ELSE CASE WHEN u.time_limit_unlimited=1 THEN '9999-12-31' ELSE " . $ilDB->fromUnixtime("u.time_limit_until") . " END END access_until," . " CASE WHEN " . $ilDB->unixTimestamp() . " BETWEEN u.time_limit_from AND u.time_limit_until THEN 0 ELSE 1 END expired," . "rq.role_disk_quota, system_role.rol_id role_id, " . "p1.value+0 user_disk_quota," . "p2.value+0 disk_usage, " . "p3.value last_update, " . "p5.value language, " . "CASE WHEN rq.role_disk_quota>p1.value+0 OR p1.value IS NULL THEN rq.role_disk_quota ELSE p1.value+0 END disk_quota\t" . "FROM usr_data u " . "JOIN (SELECT u.usr_id usr_id,MAX(rd.disk_quota) role_disk_quota " . "FROM usr_data u " . "JOIN rbac_ua ua ON ua.usr_id=u.usr_id " . "JOIN rbac_fa fa ON fa.rol_id=ua.rol_id AND fa.parent=%s " . "JOIN role_data rd ON rd.role_id=ua.rol_id WHERE u.usr_id=ua.usr_id GROUP BY u.usr_id) rq ON rq.usr_id=u.usr_id " . "LEFT JOIN rbac_ua system_role ON system_role.usr_id=u.usr_id AND system_role.rol_id = %s " . "LEFT JOIN usr_pref p1 ON p1.usr_id=u.usr_id AND p1.keyword = 'disk_quota' " . "LEFT JOIN usr_pref p2 ON p2.usr_id=u.usr_id AND p2.keyword = 'disk_usage' " . "LEFT JOIN usr_pref p3 ON p3.usr_id=u.usr_id AND p3.keyword = 'disk_usage.last_update' " . "LEFT JOIN usr_pref p5 ON p5.usr_id=u.usr_id AND p5.keyword = 'language' " . 'WHERE (((p1.value+0 > rq.role_disk_quota OR rq.role_disk_quota IS NULL) AND p2.value+0 > p1.value+0) OR
((rq.role_disk_quota > p1.value+0 OR p1.value IS NULL) AND p2.value+0 > rq.role_disk_quota)) ' . 'AND (u.active=1 AND (u.time_limit_unlimited = 1 OR ' . $ilDB->unixTimestamp() . ' BETWEEN u.time_limit_from AND u.time_limit_until)) ', array('integer', 'integer'), array(ROLE_FOLDER_ID, SYSTEM_ROLE_ID));
$users = array();
$counter = 0;
while ($row = $ilDB->fetchAssoc($res)) {
$details = ilDiskQuotaChecker::_lookupDiskUsage($row['usr_id']);
$users[$counter]['disk_quota'] = $row['disk_quota'];
$users[$counter]['disk_usage'] = $details['disk_usage'];
$users[$counter]['email'] = $row['email'];
$users[$counter]['firstname'] = $row['firstname'];
$users[$counter]['lastname'] = $row['lastname'];
++$counter;
}
if (count($users)) {
foreach ($this->getRecipients() as $rcp) {
$usrId = ilObjUser::_lookupId($rcp);
$this->initLanguage($usrId);
$this->initMail();
$this->setSubject($this->getLanguage()->txt('disk_quota_summary_subject'));
$this->setBody(ilMail::getSalutation($usrId, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguage()->txt('disk_quota_exceeded_headline'));
$this->appendBody("\n\n");
$first = true;
$counter = 0;
$numUsers = count($users);
foreach ($users as $user) {
if (!$first) {
$this->appendBody("\n---------------------------------------------------\n\n");
}
$this->appendBody($this->getLanguage()->txt('fullname') . ': ' . $user['lastname'] . ', ' . $user['firstname'] . "\n");
$this->appendBody($this->getLanguage()->txt('email') . ': ' . $user['email'] . "\n");
$this->appendBody($this->getLanguage()->txt('disk_quota') . ': ' . ilFormat::formatSize($user['disk_quota'], 'short', $this->getLanguage()) . "\n");
$this->appendBody($this->getLanguage()->txt('currently_used_disk_space') . ': ' . ilFormat::formatSize($user['disk_usage'], 'short', $this->getLanguage()) . "\n");
$this->appendBody($this->getLanguage()->txt('usrf_profile_link') . ': ' . ilUtil::_getHttpPath() . '/goto.php?target=usrf&client_id=' . CLIENT_ID);
if ($counter < $numUsers - 1) {
$this->appendBody("\n");
}
++$counter;
$first = false;
}
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'), false);
}
}
}
}
示例5: send
/**
* Parse and send mail
* @return
*/
public function send()
{
switch ($this->getType()) {
case self::TYPE_NOTIFICATION_APPROVERS:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject($this->getLanguageText('reg_mail_new_user'));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('reg_mail_body_profile'));
$info = $this->getAdditionalInformation();
$this->appendBody("\n\n");
$this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('reg_mail_body_reason'));
$this->getMail()->appendInstallationSignature(true);
$this->getMail()->enableSoap(false);
$this->sendMail(array($rcp), array('system'));
}
break;
case self::TYPE_NOTIFICATION_CONFIRMATION:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject($this->getLanguageText('reg_mail_new_user_confirmation'));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('reg_mail_new_user_body'));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('reg_mail_body_profile'));
$info = $this->getAdditionalInformation();
$this->appendBody("\n\n");
$this->appendBody($info['usr']->getProfileAsString($this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('reg_mail_body_confirmation'));
$this->appendBody("\n");
// #4527
include_once "Services/Link/classes/class.ilLink.php";
$this->appendBody(ilLink::_getStaticLink($info['usr']->getId(), "usrf"));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('reg_mail_body_reason'));
$this->getMail()->appendInstallationSignature(true);
$this->getMail()->enableSoap(false);
$this->sendMail(array($rcp), array('system'));
}
break;
}
}
示例6: send
/**
* Send notifications
* @return
*/
public function send()
{
global $ilUser;
// parent::send();
include_once "./Modules/Exercise/classes/class.ilExAssignment.php";
switch ($this->getType()) {
case self::TYPE_FEEDBACK_FILE_ADDED:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('exc_msg_new_feedback_file_uploaded'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('exc_msg_new_feedback_file_uploaded2'));
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('obj_exc') . ": " . $this->getObjectTitle(true));
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('exc_assignment') . ": " . ilExAssignment::lookupTitle($this->getAssignmentId()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('exc_mail_permanent_link'));
$this->appendBody("\n");
$this->appendBody($this->createPermanentLink(array(), '_' . $this->getAssignmentId()) . '#fb' . $this->getAssignmentId());
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
case self::TYPE_SUBMISSION_UPLOAD:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('exc_submission_notification_subject'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('exc_submission_notification_body'), $this->getObjectTitle(true)));
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('exc_assignment') . ": " . ilExAssignment::lookupTitle($this->getAssignmentId()));
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('user') . ": " . $ilUser->getFullName());
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('exc_submission_notification_link'), $this->createPermanentLink()));
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
}
return true;
}
示例7: send
public function send()
{
include_once './Services/Link/classes/class.ilLink.php';
$obj = new ilObjectFactory();
$instance = $obj->getInstanceByRefId($_GET['ref_id']);
$link = ilLink::_getLink($_GET['ref_id'], $instance->getType(), array(), '');
global $lng;
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($lng->txt('rubric_exercise_graded') . ' ' . ilObject::_lookupTitle($this->getObjId()) . ' ' . $lng->txt('rubric_is_now_available'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($lng->txt('rubric_exercise_graded') . ' ' . ilObject::_lookupTitle($this->getObjId()) . ' ' . $lng->txt('rubric_is_now_available'));
$this->appendBody("\n");
$this->appendBody($this->getLanguageText('obj_exc') . ": " . $this->getObjectTitle(true));
$this->appendBody("\n");
$this->appendBody("\n\n");
$this->appendBody($link);
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
}
示例8: send
public function send()
{
global $lng;
$customer_array = $this->_getObjectsToRemind();
foreach ($customer_array as $user_id => $objects_array) {
$this->initLanguage($user_id);
$user_lang = $this->getLanguage() ? $this->getLanguage() : $lng;
$this->initMail();
$this->setRecipients($user_id);
$this->setSubject($this->getLanguageText('payment_reminder_notification_subject'));
$this->setBody(ilMail::getSalutation($user_id, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($user_lang->txt('bought_objects_expire_soon'));
$this->appendBody("\n\n");
foreach ($objects_array as $key => $pobject) {
$this->appendBody("----------------------------------------------------------------------------------------------");
$this->appendBody("\n\n");
$this->appendBody($user_lang->txt('title') . ": " . $objects_array[$key]['object_title'] . "\n");
$this->appendBody($user_lang->txt('access_enddate') . ": " . $objects_array[$key]['access_enddate']);
$this->appendBody("\n");
$this->appendBody("\n\n");
}
$this->appendBody("----------------------------------------------------------------------------------------------");
//@todo fix this: $mailbox_link
$this->appendBody($mailbox_link);
$this->appendBody("\n\n");
$this->appendBody(ilMail::_getAutoGeneratedMessageString($this->getLanguage()));
$this->appendBody(ilMail::_getInstallationSignature());
$mmail = new ilMimeMail();
$mmail->autoCheck(false);
$mmail->From('noreply');
$mmail->To(ilObjUser::_lookupEmail($user_id));
$mmail->Subject($this->getSubject());
$mmail->Body($this->getBody());
$mmail->Send();
}
}
示例9: sendUserResultsMail
public function sendUserResultsMail($a_active_id, $a_recipient)
{
global $ilUser;
$finished = $this->object->getSurveyParticipants(array($a_active_id));
$finished = array_pop($finished);
$finished = ilDatePresentation::formatDate(new ilDateTime($finished["finished_tstamp"], IL_CAL_UNIX));
require_once "Services/Mail/classes/class.ilMail.php";
require_once "Services/Link/classes/class.ilLink.php";
$body = ilMail::getSalutation($ilUser->getId()) . "\n\n";
$body .= $this->lng->txt("svy_mail_own_results_body") . "\n";
$body .= "\n" . $this->lng->txt("obj_svy") . ": " . $this->object->getTitle() . "\n";
$body .= ilLink::_getLink($this->object->getRefId(), "svy") . "\n";
$body .= "\n" . $this->lng->txt("survey_results_finished") . ": " . $finished . "\n\n";
$body .= $this->getUserResultsPlain($a_active_id);
// $body .= ilMail::_getAutoGeneratedMessageString($this->lng);
$body .= ilMail::_getInstallationSignature();
require_once "Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
$mail->sendMimeMail($a_recipient, null, null, sprintf($this->lng->txt("svy_mail_own_results_subject"), $this->object->getTitle()), $body, null, true);
}
示例10: send
/**
* Send notifications
* @return
*/
public function send()
{
global $ilSetting;
// parent::send();
switch ($this->getType()) {
case self::TYPE_ADMISSION_MEMBER:
// automatic mails about status change disabled
if (!$ilSetting->get('mail_grp_member_notification', false)) {
return;
}
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('grp_mail_admission_new_sub'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('grp_mail_admission_new_bod'), $this->getObjectTitle()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
case self::TYPE_DISMISS_MEMBER:
// automatic mails about status change disabled
if (!$ilSetting->get('mail_grp_member_notification', false)) {
return;
}
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('grp_mail_dismiss_sub'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('grp_mail_dismiss_bod'), $this->getObjectTitle()));
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
case self::TYPE_SUBSCRIBE_MEMBER:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('grp_mail_subscribe_member_sub'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('grp_mail_subscribe_member_bod'), $this->getObjectTitle()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
case self::TYPE_NOTIFICATION_REGISTRATION_REQUEST:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('grp_mail_notification_reg_req_sub'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$info = $this->getAdditionalInformation();
$this->appendBody(sprintf($this->getLanguageText('grp_mail_notification_reg_req_bod'), $this->userToString($info['usr_id']), $this->getObjectTitle()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('grp_mail_notification_reg_req_bod2'));
$this->appendBody("\n");
$this->appendBody($this->createPermanentLink(array(), '_mem'));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('grp_notification_explanation_admin'));
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
case self::TYPE_REFUSED_SUBSCRIPTION_MEMBER:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('sess_mail_sub_dec_sub'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('sess_mail_sub_dec_bod'), $this->getObjectTitle()));
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp), array('system'));
}
break;
case self::TYPE_ACCEPTED_SUBSCRIPTION_MEMBER:
foreach ($this->getRecipients() as $rcp) {
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('sess_mail_sub_acc_sub'), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('sess_mail_sub_acc_bod'), $this->getObjectTitle()));
//.........这里部分代码省略.........
示例11: composeSequenceBookingMailForCreator
/**
* Compose notification of sequence booking for the creator of that booking.
*
* @param array $a_user_id The user who will get the mail.
* Returns nothing.
*/
private function composeSequenceBookingMailForCreator($a_user_id)
{
$lng = $this->lng;
$this->initLanguage($a_user_id);
$this->initMail();
$this->setSubject($this->lng->txt('rep_robj_xrs_mail_sequencebook_creator_subject'));
$this->setBody(ilMail::getSalutation($a_user_id, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($lng->txt('rep_robj_xrs_mail_sequencebook_cre ator_message') . "\n");
$this->appendBody($lng->txt('rep_robj_xrs_room') . " ");
$this->appendBody($this->s_roomname . " ");
$this->appendBody($lng->txt('rep_robj_xrs_from') . " ");
$this->appendBody($this->datestart->get(IL_CAL_FKT_DATE, 'd.m.Y H:s') . " ");
$this->appendBody($lng->txt('rep_robj_xrs_to') . " ");
$this->appendBody($this->dateend->get(IL_CAL_FKT_DATE, 'd.m.Y H:s'));
$this->appendBody("\n\n");
$this->appendBody(ilMail::_getAutoGeneratedMessageString($this->language));
}
示例12: send
/**
*
* @return
*/
public function send()
{
global $rbacreview, $lng;
switch ($this->getType()) {
case self::TYPE_USER:
$rcp = array_pop($this->getRecipients());
$this->initLanguage($rcp);
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_mail_notification_subject'), $this->getAppointment()->getTitle()));
$this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cal_mail_notification_body'));
$this->appendBody("\n\n");
$this->appendAppointmentDetails();
$this->appendBody("\n\n");
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail($this->getRecipients(), array('system'), true);
break;
case self::TYPE_USER_ANONYMOUS:
$rcp = array_pop($this->getRecipients());
$this->setLanguage(ilLanguageFactory::_getLanguage($lng->getDefaultLanguage()));
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->getLanguage()->loadLanguageModule('mail');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_mail_notification_subject'), $this->getAppointment()->getTitle()));
$this->setBody(ilMail::getSalutation(0, $this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('cal_mail_notification_body'));
$this->appendBody("\n\n");
$this->appendAppointmentDetails();
$this->appendBody("\n\n");
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail($this->getRecipients(), array('email'), false);
break;
case self::TYPE_GRP_NEW_NOTIFICATION:
$this->setLanguage(ilLanguageFactory::_getLanguage($lng->getDefaultLanguage()));
$this->getLanguage()->loadLanguageModule('grp');
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_grp_new_notification_sub'), $this->getObjectTitle(true)));
$this->setBody($this->getLanguageText('grp_notification_salutation'));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('cal_grp_new_notification_body'), $this->getObjectTitle(true)));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendAppointmentDetails();
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail(array('#il_grp_admin_' . $this->getRefId(), '#il_grp_member_' . $this->getRefId()), array('system'), false);
break;
case self::TYPE_GRP_NOTIFICATION:
$this->setLanguage(ilLanguageFactory::_getLanguage($lng->getDefaultLanguage()));
$this->getLanguage()->loadLanguageModule('grp');
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_grp_notification_sub'), $this->getObjectTitle(true)));
$this->setBody($this->getLanguageText('grp_notification_salutation'));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('cal_grp_notification_body'), $this->getObjectTitle(true)));
$this->appendBody("\n\n");
$this->appendAppointmentDetails();
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('grp_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail(array('#il_grp_admin_' . $this->getRefId(), '#il_grp_member_' . $this->getRefId()), array('system'), false);
break;
case self::TYPE_CRS_NEW_NOTIFICATION:
$this->setLanguage(ilLanguageFactory::_getLanguage($lng->getDefaultLanguage()));
$this->getLanguage()->loadLanguageModule('crs');
$this->getLanguage()->loadLanguageModule('dateplaner');
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText('cal_crs_new_notification_sub'), $this->getObjectTitle(true)));
$this->setBody($this->getLanguageText('crs_notification_salutation'));
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('cal_crs_new_notification_body'), $this->getObjectTitle(true)));
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('crs_mail_permanent_link'));
$this->appendBody("\n\n");
$this->appendAppointmentDetails();
$this->appendBody("\n\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->addAttachment();
$this->sendMail(array('#il_crs_admin_' . $this->getRefId(), '#il_crs_tutor_' . $this->getRefId(), '#il_crs_member_' . $this->getRefId()), array('system'), false);
break;
case self::TYPE_CRS_NOTIFICATION:
$this->setLanguage(ilLanguageFactory::_getLanguage($lng->getDefaultLanguage()));
//.........这里部分代码省略.........
示例13: send
public function send()
{
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");
$this->appendBody(ilMail::_getAutoGeneratedMessageString($this->getLanguage()));
$this->appendBody(ilMail::_getInstallationSignature());
$mmail = new ilMimeMail();
$mmail->autoCheck(false);
$mmail->From(ilMail::getIliasMailerAddress());
$mmail->To(ilObjUser::_lookupEmail($user_id));
$mmail->Subject($this->getSubject());
$mmail->Body($this->getBody());
$mmail->Send();
}
}
示例14: compose
/**
* Compose notification to single recipient
*
* @param mixed $a_rcp
* @param string $a_goto_additional
* @param string $a_permission
* @param bool $a_append_signature_direct
* @return bool
*/
public function compose($a_user_id, $a_goto_additional = null, $a_permission = "read", $a_append_signature_direct = false)
{
$this->initLanguage($a_user_id);
$this->initMail();
$this->setSubject(sprintf($this->getLanguageText($this->subject_lang_id), $this->getObjectTitle(true)));
$this->setBody(ilMail::getSalutation($a_user_id, $this->getLanguage()));
$this->appendBody("\n\n");
if ($this->introduction) {
$this->appendBody($this->getLanguageText($this->introduction));
$this->appendBody("\n\n");
}
if ($this->introduction_direct) {
$this->appendBody($this->introduction_direct);
$this->appendBody("\n\n");
}
if ($this->task) {
$this->appendBody($this->getLanguageText($this->task));
$this->appendBody("\n\n");
}
// details table
if ($this->getObjId()) {
$this->appendBody($this->getLanguageText("obj_" . $this->getObjType()) . ": " . $this->getObjectTitle() . "\n");
}
if (sizeof($this->additional)) {
foreach ($this->additional as $lang_id => $item) {
if (!$item[1]) {
$this->appendBody($this->getLanguageText($lang_id) . ": " . $item[0] . "\n");
} else {
$this->appendBody("\n" . $this->getLanguageText($lang_id) . "\n" . $this->getBlockBorder() . $item[0] . "\n" . $this->getBlockBorder() . "\n");
}
}
}
$this->body = trim($this->body);
$this->appendBody("\n\n");
if ($this->changed_by) {
$this->appendBody($this->getLanguageText("system_notification_installation_changed_by") . ": " . ilUserUtil::getNamePresentation($this->changed_by));
$this->appendBody("\n\n");
}
if ($this->getObjId()) {
// try to find accessible ref_id
if (!$this->getRefId() && $this->all_ref_ids) {
$find_ref_id = true;
foreach ($this->all_ref_ids as $ref_id) {
if ($this->isRefIdAccessible($a_user_id, $ref_id, $a_permission)) {
$this->ref_id = $ref_id;
break;
}
}
}
// check if initially given ref_id is accessible for current recipient
if ($this->getRefId() && !$find_ref_id && !$this->isRefIdAccessible($a_user_id, $this->getRefId(), $a_permission)) {
return false;
}
$goto = $this->createPermanentLink(array(), $a_goto_additional);
if ($goto) {
$this->appendBody($this->getLanguageText($this->goto_caption) . ": " . $goto);
$this->appendBody("\n\n");
}
if ($find_ref_id) {
$this->ref_id = null;
}
}
if ($this->reason) {
$this->appendBody($this->getLanguageText($this->reason));
$this->appendBody("\n\n");
}
$this->appendBody(ilMail::_getAutoGeneratedMessageString($this->language));
// signature will append new lines
$this->body = trim($this->body);
if (!$a_append_signature_direct) {
$this->getMail()->appendInstallationSignature(true);
} else {
$this->appendBody(ilMail::_getInstallationSignature());
}
return true;
}
示例15: deleteOwnAccount4
/**
* Delete own account dialog - action incl. notification email
*/
protected function deleteOwnAccount4()
{
global $ilUser, $ilAuth, $ilSetting, $ilLog;
if (!(bool) $ilSetting->get('user_delete_own_account') || $ilUser->getId() == SYSTEM_USER_ID || !$ilUser->hasDeletionFlag()) {
$this->ctrl->redirect($this, "showGeneralSettings");
}
include_once "Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
// send mail(s)
$subject = $this->lng->txt("user_delete_own_account_email_subject");
$message = $this->lng->txt("user_delete_own_account_email_body");
// salutation/info
ilDatePresentation::setUseRelativeDates(false);
$message = ilMail::getSalutation($ilUser->getId()) . "\n\n" . sprintf($message, $ilUser->getLogin(), ILIAS_HTTP_PATH, ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
// add profile data (see ilAccountRegistrationGUI)
$message .= "\n\n" . $ilUser->getProfileAsString($this->lng);
// signatur
$message .= ilMail::_getInstallationSignature();
$user_email = $ilUser->getEmail();
$admin_mail = $ilSetting->get("user_delete_own_account_email");
// to user, admin as bcc
if ($user_email) {
$mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null, true);
} else {
if ($admin_mail) {
$mail->sendMimeMail($admin_mail, null, null, $subject, $message, null, true);
}
}
$ilLog->write("Account deleted: " . $ilUser->getLogin() . " (" . $ilUser->getId() . ")");
$ilUser->delete();
// terminate session
$ilAuth->logout();
session_destroy();
ilUtil::redirect("login.php?accdel=1");
}