当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Mail::clearSubject方法代码示例

本文整理汇总了PHP中Zend_Mail::clearSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Mail::clearSubject方法的具体用法?PHP Zend_Mail::clearSubject怎么用?PHP Zend_Mail::clearSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Mail的用法示例。


在下文中一共展示了Zend_Mail::clearSubject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: grade_below_threshold_notice

function grade_below_threshold_notice($assessment_list)
{
    global $db, $AGENT_CONTACTS;
    $assessment_list = (array) $assessment_list;
    foreach ($assessment_list as $assessment_id => $assessment) {
        $mail = new Zend_Mail();
        $mail->addHeader("X-Originating-IP", $_SERVER["REMOTE_ADDR"]);
        $mail->addHeader("X-Section", "Gradebook Notification System", true);
        $mail->clearFrom();
        $mail->clearSubject();
        $mail->setFrom($AGENT_CONTACTS["agent-notifications"]["email"], APPLICATION_NAME . ' Gradebook System');
        $mail->setSubject("Grade Below Threshold Notification");
        $message = "<pre>This notification is being sent to inform you that students scored below the assessment threshold.\n\n";
        $message .= "Course:\t\t\t" . $assessment["course_name"] . " - " . $assessment["course_code"] . "\n";
        $message .= "Assessment:\t\t<a href=\"" . ENTRADA_URL . "/admin/gradebook/assessments?section=grade&id=" . $assessment["course_id"] . "&assessment_id=" . $assessment_id . "\">" . $assessment["assessment_name"] . "</a>\n";
        $message .= "Assessment ID:\t\t" . $assessment_id . "\n";
        $message .= "Grade Threshold:\t" . $assessment["threshold"] . "%\n\n";
        $message .= "The following students scored below the assessment threshold:\n";
        $message .= "-------------------------------------------------------------\n\n";
        foreach ($assessment["students"] as $proxy_number => $student) {
            $query = "\tUPDATE `assessment_grades`\n\t\t\t\t\t\tSET `threshold_notified` = '1'\n\t\t\t\t\t\tWHERE `grade_id` = " . $db->qstr($student["grade_id"]);
            $result = $db->Execute($query);
            $message .= "Student:\t\t" . $student["student_name"] . " - [" . $student["student_email"] . "] \n";
            $message .= "Student Number:\t\t" . $student["student_number"] . "\n";
            $message .= "Grade Recieved:\t\t" . $student["assessment_grade"] . "%\n\n";
        }
        $message .= "</pre>";
        $mail->setBodyHtml($message);
        $query = "\tSELECT a.`contact_type`, a.`contact_order`, b.`prefix`, b.`firstname`, b.`lastname`, b.`email`, a.`proxy_id`\n\t\t\tFROM " . DATABASE_NAME . ".`course_contacts` AS a \n\t\t\tJOIN " . AUTH_DATABASE . ".`user_data` AS b \n\t\t\tON a.`proxy_id` = b.`id`  \n\t\t\tWHERE a.`course_id` = " . $db->qstr($assessment["course_id"]) . "\n\t\t\tORDER BY a.`contact_type` DESC, a.`contact_order` ASC";
        $contacts = $db->GetAll($query);
        foreach ($contacts as $contact) {
            $mail->addTo($contact["email"], (!empty($contact["prefix"]) ? $contact["prefix"] . " " : "") . $contact["firstname"] . " " . $contact["lastname"]);
            $contact_proxies[] = $contact["proxy_id"];
        }
        $sent = true;
        try {
            $mail->send();
        } catch (Exception $e) {
            $sent = false;
        }
        if ($sent) {
            application_log("success", "Sent grade below threshold notification to Program Coordinators / Directors [" . implode(",", $contact_proxies) . "].");
            $return_value = true;
        } else {
            application_log("error", "Unable to send grade below threshold notification to Program Coordinators / Directors [" . implode(",", $contact_proxies) . "].");
        }
    }
}
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:48,代码来源:check_grade_thresholds.php

示例2: array

 * @author Organisation: Queen's University
 * @author Unit: Faculty of Medicine
 * @author Developer: Brandon Thorn <brandon.thorn@queensu.ca>
 * @author Developer: Ryan Warner <ryan.warner@queensu.ca>
 * @copyright Copyright 2012 Queen's Univerity. All Rights Reserved.
 * if they're doing a clerkship rotation in a location that the regional education manages (oshawa)
 */
@set_time_limit(0);
@set_include_path(implode(PATH_SEPARATOR, array(dirname(__FILE__) . "/../core", dirname(__FILE__) . "/../core/includes", dirname(__FILE__) . "/../core/library", get_include_path())));
/**
 * Include the Entrada init code.
 */
require_once "init.inc.php";
$search = array("%LEARNER_NAME%", "%ACCOMMODATION_TITLE%", "%ACCOMMODATION_NUMBER%", "%ACCOMMODATION_STREET%", "%ACCOMMODATION_REGION%", "%INHABITING_START%", "%INHABITING_FINISH%", "%ACCOMMODATION_CONTACT_NAME%", "%ACCOMMODATION_CONTACT_INFO%", "%ACCOMMODATION_LINK%", "%APPLICATION_NAME%");
$mail = new Zend_Mail();
$query = "\tSELECT c.`username`,\n\t\t\t\tCONCAT_WS(' ', c.`firstname`, c.`lastname`) AS `fullname`,\n\t\t\t\tc.`email`,\n\t\t\t\ta.`apartment_title`,\n\t\t\t\ta.`apartment_number`,\n\t\t\t\ta.`apartment_address`,\n\t\t\t\td.`region_name`,\n\t\t\t\ta.`apartment_province`,\n\t\t\t\tb.`aschedule_id`,\n\t\t\t\tFROM_UNIXTIME(b.inhabiting_start) AS inhabiting_start,\n\t\t\t\tFROM_UNIXTIME(b.inhabiting_finish) AS inhabiting_finish,\n\t\t\t\te.`department_id`,\n\t\t\t\te.`department_title`\n\t\t\tFROM `" . CLERKSHIP_DATABASE . "`.`apartments` AS a\n\t\t\tLEFT JOIN `" . CLERKSHIP_DATABASE . "`.`apartment_schedule` AS b\n\t\t\tON a.`apartment_id` = b.`apartment_id`\n\t\t\tLEFT JOIN `" . AUTH_DATABASE . "`.`user_data` as c\n\t\t\tON b.`proxy_id` = c.`id`\n\t\t\tLEFT JOIN `" . CLERKSHIP_DATABASE . "`.`regions` as d\n\t\t\tON a.`region_id` = d.`region_id`\n\t\t\tLEFT JOIN `" . AUTH_DATABASE . "`.`departments` as e\n\t\t\tON a.`department_id` = e.`department_id`\n\t\t\tWHERE b.`occupant_title` = ''\n\t\t\tAND DATEDIFF(FROM_UNIXTIME(b.`inhabiting_start`), FROM_UNIXTIME('" . time() . "')) = 30";
$occupants = $db->GetAll($query);
if ($occupants) {
    $email_body = file_get_contents(ENTRADA_ABSOLUTE . "/templates/" . $ENTRADA_TEMPLATE->activeTemplate() . "/email/regionaled-learner-accommodation-notification.txt");
    foreach ($occupants as $occupant) {
        $mail->addHeader("X-Section", $occupant["department_title"] . " Accommodation Notification System", true);
        $mail->setFrom($AGENT_CONTACTS["agent-regionaled"][$occupant["department_id"]]["email"], $AGENT_CONTACTS["agent-regionaled"][$occupant["department_id"]]["name"]);
        $mail->clearSubject();
        $mail->setSubject("Regional Accomodation: " . $occupant["region_name"]);
        $replace = array($occupant["fullname"], $occupant["apartment_title"], $occupant["apartment_number"], $occupant["apartment_address"], $occupant["region_name"], date("l, F j, Y", strtotime($occupant["inhabiting_start"])), date("l, F j, Y", strtotime($occupant["inhabiting_finish"])), $AGENT_CONTACTS["agent-regionaled"][$occupant["department_id"]]["name"], $AGENT_CONTACTS["agent-regionaled"][$occupant["department_id"]]["email"], "https://meds.queensu.ca/central/regionaled/view?id=" . $occupant["aschedule_id"], $AGENT_CONTACTS["agent-regionaled"][$occupant["department_id"]]["name"]);
        $mail->setBodyText(str_replace($search, $replace, $email_body));
        $mail->clearRecipients();
        $mail->addTo($occupant["email"], $occupant["fullname"]);
        $mail->send();
    }
}
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:31,代码来源:regionaled-occupant-notification.php

示例3: notify_regional_education


//.........这里部分代码省略.........
                        break;
                    case "change-critical":
                        $message = "Attention " . $AGENT_CONTACTS["agent-regionaled"]["name"] . ",\n\n";
                        $message .= $_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"] . " has updated an event in " . $whole_name . "'s ";
                        $message .= "clerkship schedule, to which you had previously assigned housing. This update involves a change to the region or the ";
                        $message .= "dates that the event took place in. Due to this critical change taking place, the housing for this event for this ";
                        $message .= "student has been removed.\n\n";
                        if ($result["manage_apartments"]) {
                            $message .= "Please log into the clerkship system and re-assign housing to this student for this event.\n\n";
                        } else {
                            $message .= "Since this event no longer is taking place in a region which is managed by Regional Education, \n";
                            $message .= "no further action is required on your part in the system.\n\n";
                        }
                        $message .= "Information For Reference:\n\n";
                        $message .= "OLD Event Information:\n";
                        $message .= "Event Title:\t" . $event_info["event_title"] . "\n";
                        $message .= "Region:\t\t" . get_region_name($event_info["region_id"]) . "\n";
                        $message .= "Start Date:\t" . date(DEFAULT_DATE_FORMAT, $event_info["event_start"]) . "\n";
                        $message .= "Finish Date:\t" . date(DEFAULT_DATE_FORMAT, $event_info["event_finish"]) . "\n\n";
                        $message .= "NEW Event Information:\n";
                        $message .= "Event Title:\t" . html_decode($result["event_title"]) . "\n";
                        $message .= "Region:\t\t" . $result["region_name"] . "\n";
                        $message .= "Start Date:\t" . date(DEFAULT_DATE_FORMAT, $result["event_start"]) . "\n";
                        $message .= "Finish Date:\t" . date(DEFAULT_DATE_FORMAT, $result["event_finish"]) . "\n\n";
                        if ($apartments && ($assigned_apartments = @count($apartments))) {
                            $message .= "Apartment" . ($assigned_apartments != 1 ? "s" : "") . " " . $whole_name . " was removed from:\n";
                            foreach ($apartments as $apartment) {
                                $message .= "Apartment Title:\t" . $apartment["apartment_title"] . "\n";
                                $message .= "Inhabiting Start:\t" . date(DEFAULT_DATE_FORMAT, $apartment["inhabiting_start"]) . "\n";
                                $message .= "Inhabiting Finish:\t" . date(DEFAULT_DATE_FORMAT, $apartment["inhabiting_finish"]) . "\n\n";
                            }
                        }
                        $message .= "=======================================================\n\n";
                        $message .= "Deletion Date:\t" . date("r", time()) . "\n";
                        $message .= "Deleted By:\t" . $_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"] . " (" . $ENTRADA_USER->getID() . ")\n";
                        break;
                    case "change-non-critical":
                    case "updated":
                    default:
                        $message = "Attention " . $AGENT_CONTACTS["agent-regionaled"]["name"] . ",\n\n";
                        $message .= $_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"] . " has updated an event in " . $whole_name . "'s ";
                        $message .= "clerkship schedule, to which you had previously assigned housing.\n\n";
                        $message .= "Important:\n";
                        $message .= "This update does not affect the date or region of this event, as such this change is considered non-critical ";
                        $message .= "and no action is required on your part.\n\n";
                        $message .= "Information For Reference:\n\n";
                        $message .= "OLD Event Information:\n";
                        $message .= "Event Title:\t" . $event_info["event_title"] . "\n";
                        $message .= "Region:\t\t" . get_region_name($event_info["region_id"]) . "\n";
                        $message .= "Start Date:\t" . date(DEFAULT_DATE_FORMAT, $event_info["event_start"]) . "\n";
                        $message .= "Finish Date:\t" . date(DEFAULT_DATE_FORMAT, $event_info["event_finish"]) . "\n\n";
                        $message .= "NEW Event Information:\n";
                        $message .= "Event Title:\t" . html_decode($result["event_title"]) . "\n";
                        $message .= "Region:\t\t" . $result["region_name"] . "\n";
                        $message .= "Start Date:\t" . date(DEFAULT_DATE_FORMAT, $result["event_start"]) . "\n";
                        $message .= "Finish Date:\t" . date(DEFAULT_DATE_FORMAT, $result["event_finish"]) . "\n\n";
                        if ($apartments && ($assigned_apartments = @count($apartments))) {
                            $message .= "Apartment" . ($assigned_apartments != 1 ? "s" : "") . " " . $whole_name . " is assigned to:\n";
                            foreach ($apartments as $apartment) {
                                $message .= "Apartment Title:\t" . $apartment["apartment_title"] . "\n";
                                $message .= "Inhabiting Start:\t" . date(DEFAULT_DATE_FORMAT, $apartment["inhabiting_start"]) . "\n";
                                $message .= "Inhabiting Finish:\t" . date(DEFAULT_DATE_FORMAT, $apartment["inhabiting_finish"]) . "\n\n";
                            }
                        }
                        $message .= "=======================================================\n\n";
                        $message .= "Updated Date:\t" . date("r", time()) . "\n";
                        $message .= "Update By:\t" . $_SESSION["details"]["firstname"] . " " . $_SESSION["details"]["lastname"] . " (" . $ENTRADA_USER->getID() . ")\n";
                        break;
                }
                $mail = new Zend_Mail();
                $mail->addHeader("X-Originating-IP", $_SERVER["REMOTE_ADDR"]);
                $mail->addHeader("X-Section", "Clerkship Notify System", true);
                $mail->clearFrom();
                $mail->clearSubject();
                $mail->setFrom($AGENT_CONTACTS["agent-notifications"]["email"], APPLICATION_NAME . ' Clerkship System');
                $mail->setSubject("MEdTech Clerkship System - " . ucwords($action) . " Event");
                $mail->setBodyText($message);
                $mail->clearRecipients();
                $mail->addTo($AGENT_CONTACTS["agent-regionaled"]["email"], $AGENT_CONTACTS["agent-regionaled"]["name"]);
                $sent = true;
                try {
                    $mail->send();
                    application_log("success", "An event change notification has been sent to regional education to notify them of the changes to the event [" . $event_info["event_id"] . "] which will affect the apartment schedule.");
                    return true;
                } catch (Exception $e) {
                    system_log_data("error", "Unable to send " . $action . " notification to regional education. Zend_mail said: " . $e->getMessage());
                    return false;
                }
            } else {
                return true;
            }
        } else {
            // No need to notify Regional Education because the event is already over, just return true.
            return true;
        }
    } else {
        system_log_data("error", "The notify_regional_education() function returned false with no results from the database query. Database said: " . $db->ErrorMsg());
        return false;
    }
}
开发者ID:nadeemshafique,项目名称:entrada-1x,代码行数:101,代码来源:functions.inc.php


注:本文中的Zend_Mail::clearSubject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。