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


PHP Subscriber::addHistory方法代码示例

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


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

示例1: sendMail

 public static function sendMail($to, $subject, $message, $skipblacklistcheck = 0)
 {
     if (Config::TEST) {
         return 1;
     }
     # do a quick check on mail injection attempt, @@@ needs more work
     if (preg_match("/\n/", $to)) {
         //TODO: convert to new logger
         phpList::log()->notice('Error: invalid recipient, containing newlines, email blocked');
         return 0;
     }
     if (preg_match("/\n/", $subject)) {
         phpList::log()->notice('Error: invalid subject, containing newlines, email blocked');
         return 0;
     }
     if (!$to) {
         phpList::log()->notice("Error: empty To: in message with subject {$subject} to send");
         return 0;
     } elseif (!$subject) {
         phpList::log()->notice("Error: empty Subject: in message to send to {$to}");
         return 0;
     }
     if (!$skipblacklistcheck && Util::isEmailBlacklisted($to)) {
         phpList::log()->notice("Error, {$to} is blacklisted, not sending");
         Util::blacklistSubscriberByEmail($to);
         Subscriber::addHistory('Marked Blacklisted', 'Found subscriber in blacklist while trying to send an email, marked black listed', Subscriber::getSubscriberByEmailAddress($to)->id);
         return 0;
     }
     return phpListMailer::sendMailPhpMailer($to, $subject, $message);
 }
开发者ID:jbeigh,项目名称:phpList,代码行数:30,代码来源:phpListMailer.php

示例2: processBounceData

 /**
  * Porcess the bounce data and update the database
  * @param Bounce $bounce
  * @param int $campaign_id
  * @param Subscriber $subscriber
  * @return bool
  */
 private function processBounceData($bounce, $campaign_id, $subscriber)
 {
     if ($campaign_id === 'systemmessage' && $subscriber !== false) {
         $bounce->status = 'bounced system message';
         $bounce->comment = sprintf('%s marked unconfirmed', $subscriber->id);
         $bounce->update();
         phpList::log()->notice($subscriber->id . ' ' . s('system message bounced, subscriber marked unconfirmed'));
         $subscriber->addHistory(s('Bounced system message'), sprintf('<br/>%s<br/><a href="./?page=bounce&amp;id=%d">%s</a>', s('Subscriber marked unconfirmed'), $bounce->id, s('View Bounce')), $subscriber->id);
         $subscriber->confirmed = 0;
         $subscriber->update();
     } elseif (!empty($campaign_id) && $subscriber !== false) {
         $bounce->connectMeToSubscriberAndMessage($subscriber, $campaign_id);
     } elseif ($subscriber !== false) {
         $bounce->status = 'bounced unidentified message';
         $bounce->comment = $subscriber->id . ' bouncecount increased';
         $bounce->update();
         $subscriber->bouncecount++;
         $subscriber->update();
     } elseif ($campaign_id === 'systemmessage') {
         $bounce->status = 'bounced system message';
         $bounce->comment = 'unknown subscriber';
         $bounce->update();
         phpList::log()->notice($subscriber->id . ' ' . s('system message bounced, but unknown subscriber'));
     } elseif ($campaign_id) {
         $bounce->status = sprintf('bounced list message %d', $campaign_id);
         $bounce->comment = 'unknown subscriber';
         $bounce->update();
         phpList::DB()->query(sprintf('UPDATE %s
                  SET bouncecount = bouncecount + 1
                  WHERE id = %d', Config::getTableName('message'), $campaign_id));
     } else {
         $bounce->status = 'unidentified bounce';
         $bounce->comment = 'not processed';
         $bounce->update();
         return false;
     }
     return true;
 }
开发者ID:jbeigh,项目名称:phpList,代码行数:45,代码来源:BounceProcessor.php


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