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


PHP Newsletter::all方法代码示例

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


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

示例1: _newsletters

 /**
  * Sends newsletter to User groups
  */
 protected function _newsletters()
 {
     $now = date('Y-m-d');
     $emails = array();
     $newsletters = Newsletter::all(array("scheduled = ?" => $now), array("template_id", "group_id"));
     foreach ($newsletters as $n) {
         $template = Template::first(array("id = ?" => $n->template_id));
         $group = Group::first(array("id = ?" => $n->group_id), array("users"));
         $results = json_decode($group->users);
         if (count($results) == 1 && $results[0] == "*") {
             $users = User::all(array(), array("email"));
             foreach ($users as $user) {
                 array_push($emails, $user->email);
             }
         } else {
             foreach ($results as $r) {
                 array_push($emails, $r->email);
             }
         }
         $batches = array_chunk($emails, 100);
         foreach ($batches as $batch) {
             $e = implode(",", $batch);
             $this->notify(array("template" => "newsletter", "subject" => $template->subject, "message" => $template->body, "track" => true, "emails" => $e));
         }
     }
 }
开发者ID:SwiftDeal,项目名称:detectr,代码行数:29,代码来源:cron.php

示例2: index

 public function index()
 {
     // init
     $data = array('menu' => $this->_menu, 'title' => 'Newsletter', 'description' => '', 'breadcrumb' => array('Newsletter' => route('admin.newsletter')));
     // Set data
     $data['data'] = Newsletter::all();
     return View::make('admin.pages.newsletter.index')->with($data);
 }
开发者ID:whiterun,项目名称:bagikasih-v2,代码行数:8,代码来源:AdminNewsletterController.php

示例3: manageNewsletter

 /**
  * @before _secure, _admin
  */
 public function manageNewsletter()
 {
     $this->seo(array("title" => "Manage Newsletter", "keywords" => "admin", "description" => "admin", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $page = Shared\Markup::page(array("model" => "Newsletter", "where" => array()));
     $newsletters = Newsletter::all(array(), array("*"), "created", "desc", $page["limit"], $page["page"]);
     $view->set($page);
     $view->set("newsletters", $newsletters);
 }
开发者ID:SwiftDeal,项目名称:detectr,代码行数:12,代码来源:marketing.php

示例4: index

 public function index()
 {
     $newsletter = Newsletter::all();
     return View::make('admin.pages.newsletter.index')->with(['newsletter' => $newsletter]);
 }
开发者ID:stefferd,项目名称:me-consultancy,代码行数:5,代码来源:NewsletterController.php

示例5: indexMailList

 public function indexMailList(Newsletter $newsletter)
 {
     $mailList = $newsletter->all();
     return view('mail.index', compact('mailList'));
 }
开发者ID:akuo95,项目名称:Project-Vlambeer,代码行数:5,代码来源:AdminController.php


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