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


PHP Notify::send方法代码示例

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


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

示例1: runTrigger

 /**
  * Function called when a Dolibarrr business event is done.
  * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
  *
  * @param string		$action		Event action code
  * @param Object		$object     Object
  * @param User		    $user       Object user
  * @param Translate 	$langs      Object langs
  * @param conf		    $conf       Object conf
  * @return int         				<0 if KO, 0 if no triggered ran, >0 if OK
  */
 public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
 {
     if (empty($conf->notification->enabled)) {
         return 0;
     }
     // Module not active, we do nothing
     dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
     require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
     $notify = new Notify($this->db);
     $notify->send($action, $object);
     return 1;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:23,代码来源:interface_50_modNotification_Notification.class.php

示例2: Notify

 /**
  *      Function called when a Dolibarrr business event is done.
  *      All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
  *
  *      @param	string		$action		Event action code
  *      @param  Object		$object     Object
  *      @param  User		$user       Object user
  *      @param  Translate	$langs      Object langs
  *      @param  conf		$conf       Object conf
  *      @return int         			<0 if KO, 0 if no triggered ran, >0 if OK
  */
 function run_trigger($action, $object, $user, $langs, $conf)
 {
     if (empty($conf->notification->enabled)) {
         return 0;
     }
     // Module not active, we do nothing
     require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
     if ($action == 'BILL_VALIDATE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $ref = dol_sanitizeFileName($object->ref);
         $filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
         if (!file_exists($filepdf)) {
             $filepdf = '';
         }
         $filepdf = '';
         // We can't add PDF as it is not generated yet.
         $langs->load("other");
         $mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated", $object->ref);
         $notify = new Notify($this->db);
         $notify->send($action, $object->socid, $mesg, 'facture', $object->id, $filepdf);
     } elseif ($action == 'ORDER_VALIDATE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $ref = dol_sanitizeFileName($object->ref);
         $filepdf = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
         if (!file_exists($filepdf)) {
             $filepdf = '';
         }
         $filepdf = '';
         // We can't add PDF as it is not generated yet.
         $langs->load("other");
         $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated", $object->ref);
         $notify = new Notify($this->db);
         $notify->send($action, $object->socid, $mesg, 'order', $object->id, $filepdf);
     } elseif ($action == 'PROPAL_VALIDATE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $ref = dol_sanitizeFileName($object->ref);
         $filepdf = $conf->propal->dir_output . '/' . $ref . '/' . $ref . '.pdf';
         if (!file_exists($filepdf)) {
             $filepdf = '';
         }
         $filepdf = '';
         // We can't add PDF as it is not generated yet.
         $langs->load("other");
         $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated", $object->ref);
         $notify = new Notify($this->db);
         $notify->send($action, $object->socid, $mesg, 'propal', $object->id, $filepdf);
     } elseif ($action == 'FICHEINTER_VALIDATE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $ref = dol_sanitizeFileName($object->ref);
         $filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
         if (!file_exists($filepdf)) {
             $filepdf = '';
         }
         $filepdf = '';
         // We can't add PDF as it is not generated yet.
         $langs->load("other");
         $mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated", $object->ref);
         $notify = new Notify($this->db);
         $notify->send($action, $object->socid, $mesg, 'ficheinter', $object->id, $filepdf);
     } elseif ($action == 'ORDER_SUPPLIER_APPROVE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $ref = dol_sanitizeFileName($object->ref);
         $filepdf = $conf->fournisseur->dir_output . '/commande/' . $ref . '/' . $ref . '.pdf';
         if (!file_exists($filepdf)) {
             $filepdf = '';
         }
         $mesg = $langs->transnoentitiesnoconv("Hello") . ",\n\n";
         $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $object->ref, $user->getFullName($langs));
         $mesg .= "\n\n" . $langs->transnoentitiesnoconv("Sincerely") . ".\n\n";
         $notify = new Notify($this->db);
         $notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf);
     } elseif ($action == 'ORDER_SUPPLIER_REFUSE') {
         dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
         $ref = dol_sanitizeFileName($object->ref);
         $filepdf = $conf->fournisseur->dir_output . '/commande/' . $ref . '/' . $ref . '.pdf';
         if (!file_exists($filepdf)) {
             $filepdf = '';
         }
         $mesg = $langs->transnoentitiesnoconv("Hello") . ",\n\n";
         $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $object->ref, $user->getFullName($langs));
         $mesg .= "\n\n" . $langs->transnoentitiesnoconv("Sincerely") . ".\n\n";
         $notify = new Notify($this->db);
         $notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf);
     }
     // If not found
     /*
             else
             {
                 dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
//.........这里部分代码省略.........
开发者ID:nrjacker4,项目名称:crm-php,代码行数:101,代码来源:interface_50_modNotification_Notification.class.php

示例3: function

<?php

Weapon::add('on_comment_construct', function ($G, $P) use($config, $speak) {
    if ($config->is->post && ($post = $G['data'][$config->page_type])) {
        $c = $config->states->{'plugin_' . md5(File::B(__DIR__))};
        $title = $post['title'];
        $url = $post['url'] . '#' . sprintf($G['data']['comment_id'], Date::format($P['data']['id'], 'U'));
        $topic = sprintf($c->subject, $title, $url);
        $parser = Request::post('content_type', $config->html_parser->active);
        $message = '<blockquote><p>' . sprintf($c->message, $title, $url) . '</p></blockquote>';
        $message .= '<h3>' . $P['data']['name'] . '</h3>';
        $message .= $parser !== false && $parser !== 'HTML' ? Text::parse($P['data']['message'], '->html') : $P['data']['message'];
        $message .= '<p>';
        $message .= '<a href="' . $config->url . '/' . $config->manager->slug . '/comment/repair/id:' . $P['data']['id'] . '">' . $speak->edit . '</a>';
        $message .= ' / ';
        $message .= '<a href="' . $config->url . '/' . $config->manager->slug . '/comment/kill/id:' . $P['data']['id'] . '">' . $speak->delete . '</a>';
        $message .= '</p>';
        // Sending email notification ...
        if (!Guardian::happy() && Notify::send($P['data']['email'], $config->author->email, $topic, $message, 'comment:')) {
            Weapon::fire('on_comment_notify_construct', array($P, $config->author->email, $topic, $message));
        }
    }
});
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:23,代码来源:launch.php

示例4: array

            $field = Request::post('fields', array());
            include DECK . DS . 'workers' . DS . 'task.field.1.php';
            // Temporarily disallow image(s) in comment to prevent XSS
            $message = strip_tags($message, '<br><img>' . ($parser === 'HTML' ? '<a><abbr><b><blockquote><code><del><dfn><em><i><ins><p><pre><span><strong><sub><sup><time><u><var>' : ""));
            $message = preg_replace('#(\\!\\[.*?\\]\\(.*?\\))#', '`$1`', $message);
            $message = preg_replace('#<img(\\s[^<>]*?)>#', '&lt;img$1&gt;', $message);
            Page::header(array('Name' => $name, 'Email' => $email, 'URL' => $url, 'Status' => Guardian::happy() ? 'pilot' : 'passenger', 'Content Type' => $parser, 'Fields' => !empty($field) ? Text::parse($field, '->encoded_json') : false, 'UA' => Get::UA(), 'IP' => Get::IP()))->content($message)->saveTo(RESPONSE . DS . $post . '_' . Date::format($id, 'Y-m-d-H-i-s') . '_' . ($parent ? Date::format($parent, 'Y-m-d-H-i-s') : '0000-00-00-00-00-00') . $extension);
            Notify::success(Config::speak('notify_success_submitted', $speak->comment));
            if ($extension === '.hold') {
                Notify::info($speak->notify_info_comment_moderation);
            }
            Weapon::fire('on_comment_update', array($P, $P));
            Weapon::fire('on_comment_construct', array($P, $P));
            if ($config->comment_notification_email) {
                $mail = '<p>' . Config::speak('comment_notification', $article->url . '#' . sprintf($comment_id, Date::format($id, 'U'))) . '</p>';
                $mail .= '<p><strong>' . $name . ':</strong></p>';
                $mail .= $parser !== 'HTML' ? Text::parse($message, '->html') : $message;
                $mail .= '<p>' . Date::format($id, 'Y/m/d H:i:s') . '</p>';
                // Sending email notification ...
                if (!Guardian::happy()) {
                    if (Notify::send($request['email'], $config->author_email, $speak->comment_notification_subject, $mail, 'comment:')) {
                        Weapon::fire('on_comment_notification_construct', array($request, $config->author_email, $speak->comment_notification_subject, $mail));
                    }
                }
            }
            Guardian::kick($config->url_current . (!Guardian::happy() && $config->comment_moderation ? '#' . $comment_form_id : '#' . sprintf($comment_id, Date::format($id, 'U'))));
        } else {
            Guardian::kick($config->url_current . '#' . $comment_form_id);
        }
    }
});
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:task.comment.php

示例5: Notify

<?php

/**
 * Copyright (c) 2014 Keith Casey
 *
 * This code is designed to accompany the lynda.com video course "Design Patterns in PHP"
 *   by Keith Casey. If you've received this code without seeing the videos, go watch the
 *   videos. It will make way more sense and be more useful in general.
 */
require 'vendor/autoload.php';
include_once 'notify.php';
$notify = new Notify('username', 'password');
$notify->send('17035551212', '15125551212', 'body of the message');
开发者ID:raynaldmo,项目名称:php-education,代码行数:13,代码来源:index.php


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