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


PHP Kit::SendEmail方法代码示例

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


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

示例1: AlertDisplayUp

 /**
  * Alert when a Display is up
  * @param int $displayId
  * @param string $display
  * @param int $loggedIn
  * @param int $emailAlert
  */
 private function AlertDisplayUp($displayId, $display, $loggedIn, $emailAlert)
 {
     $maintenanceEnabled = Config::GetSetting('MAINTENANCE_ENABLED');
     if ($loggedIn == 0) {
         // Log display up
         $statObject = new Stat();
         $statObject->displayUp($displayId);
         // Do we need to email?
         if ($emailAlert == 1 && ($maintenanceEnabled == 'On' || $maintenanceEnabled == 'Protected') && Config::GetSetting('MAINTENANCE_EMAIL_ALERTS') == 'On') {
             $msgTo = Kit::ValidateParam(Config::GetSetting("mail_to"), _PASSWORD);
             $msgFrom = Kit::ValidateParam(Config::GetSetting("mail_from"), _PASSWORD);
             $subject = sprintf(__("Recovery for Display %s"), $display);
             $body = sprintf(__("Display %s with ID %d is now back online."), $display, $displayId);
             // Get a list of people that have view access to the display?
             if (Config::GetSetting('MAINTENANCE_ALERTS_FOR_VIEW_USERS') == 1) {
                 foreach (Display::getUsers($displayId) as $user) {
                     if ($user['email'] != '') {
                         Kit::SendEmail($user['email'], $msgFrom, $subject, $body);
                     }
                 }
             }
             // Send to the original admin contact
             Kit::SendEmail($msgTo, $msgFrom, $subject, $body);
         }
     }
 }
开发者ID:rovak73,项目名称:xibo-cms,代码行数:33,代码来源:xmdssoap4.class.php

示例2: sprintf

 // Should we send an email?
 if ($emailAlerts) {
     if (Kit::ValidateParam($display['email_alert'], _INT) == 1) {
         if ($displayGoneOffline || $alwaysAlert) {
             // Fields for email
             $subject = sprintf(__("Email Alert for Display %s"), Kit::ValidateParam($display['display'], _STRING));
             $body = sprintf(__("Display %s with ID %d was last seen at %s."), Kit::ValidateParam($display['display'], _STRING), Kit::ValidateParam($display['displayid'], _INT), date("Y-m-d H:i:s", Kit::ValidateParam($display['lastaccessed'], _INT)));
             // Get a list of people that have view access to the display?
             if ($alertForViewUsers) {
                 foreach (Display::getUsers($display['displayid']) as $user) {
                     if ($user['email'] != '') {
                         Kit::SendEmail($user['email'], $msgFrom, $subject, $body);
                     }
                 }
             }
             if (Kit::SendEmail($msgTo, $msgFrom, $subject, $body)) {
                 // Successful Alert
                 print "A";
             } else {
                 // Error sending Alert
                 print "E";
             }
         }
     } else {
         // Alert disabled for this display
         print "D";
     }
 } else {
     // Email alerts disabled globally
     print "X";
 }
开发者ID:fignew,项目名称:xibo-cms,代码行数:31,代码来源:maintenance.php

示例3: AuthDisplay

 /**
  * Authenticates the display
  * @param <type> $hardwareKey
  * @return <type>
  */
 private function AuthDisplay($hardwareKey)
 {
     $db =& $this->db;
     // check in the database for this hardwareKey
     $SQL = "SELECT licensed, inc_schedule, isAuditing, displayID, defaultlayoutid, loggedin, email_alert, display, version_instructions FROM display WHERE license = '{$hardwareKey}'";
     if (!($result = $db->query($SQL))) {
         trigger_error("License key query failed:" . $db->error());
         return false;
     }
     //Is it there?
     if ($db->num_rows($result) == 0) {
         return false;
     }
     //we have seen this display before, so check the licensed value
     $row = $db->get_row($result);
     if ($row[0] == 0) {
         return false;
     }
     // Pull the client IP address
     $clientAddress = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING);
     // See if the client was offline and if appropriate send an alert
     // to say that it has come back online
     if ($row[5] == 0 && $row[6] == 1 && Config::GetSetting('MAINTENANCE_ENABLED') == 'On' && Config::GetSetting('MAINTENANCE_EMAIL_ALERTS') == 'On') {
         $msgTo = Kit::ValidateParam(Config::GetSetting("mail_to"), _PASSWORD);
         $msgFrom = Kit::ValidateParam(Config::GetSetting("mail_from"), _PASSWORD);
         $subject = sprintf(__("Recovery for Display %s"), $row[7]);
         $body = sprintf(__("Display %s with ID %d is now back online."), $row[7], $row[3]);
         Kit::SendEmail($msgTo, $msgFrom, $subject, $body);
     }
     // Last accessed date on the display
     $displayObject = new Display($db);
     $displayObject->Touch($hardwareKey, $clientAddress);
     // It is licensed?
     $this->licensed = true;
     $this->includeSchedule = $row[1];
     $this->isAuditing = $row[2];
     $this->displayId = $row[3];
     $this->defaultLayoutId = $row[4];
     $this->version_instructions = $row[8];
     return true;
 }
开发者ID:abbeet,项目名称:server39,代码行数:46,代码来源:xmdssoap.class.php


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