本文整理汇总了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));
}
}
}
示例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);
}
示例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);
}
示例4: index
public function index()
{
$newsletter = Newsletter::all();
return View::make('admin.pages.newsletter.index')->with(['newsletter' => $newsletter]);
}
示例5: indexMailList
public function indexMailList(Newsletter $newsletter)
{
$mailList = $newsletter->all();
return view('mail.index', compact('mailList'));
}