<?php
namespace App\Http\Controllers\Admin;
+
use App\EmailBatch;
use App\FileCollection;
use App\FileTag;
$processEmailBatch = new ProcessEmailBatch($batch, $usersBuilder);
dispatch($processEmailBatch);
- if($pdfBatch = EmailBatch::createAttachmentMailFromRequest($data)) {
+ if ($pdfBatch = EmailBatch::createAttachmentMailFromRequest($data)) {
$userReceivesPdfBuilder->subscriber()->receivesPdf();
$pdfProcessEmailBatch = new ProcessEmailBatch($pdfBatch, $userReceivesPdfBuilder);
dispatch($pdfProcessEmailBatch->withFile());
}
-
-
/**
* @return ResourceCollection
*/
public function collections()
{
- $files = FileCollection::all()->map(function(FileCollection $fileCollection) {
+ $files = FileCollection::all()->map(function (FileCollection $fileCollection) {
$fileCollection->files = [$fileCollection->files()->orderByDesc('updated_at')->first()];
return $fileCollection;
});
*/
public function tags()
{
- return ['data' => FileTag::query()->get()->map(function($tag) {
+ return ['data' => FileTag::query()->get()->map(function ($tag) {
return [
'value' => $tag->content,
'text' => $tag->content
}
-
/**
* @return \Illuminate\View\View
*/
*/
public static function sendGroups(): array
{
+ $test = 'test+psq@cubedesigners.com';
+
return [
'all' => [
'slug' => 'all',
'builder' => User::query(),
- 'text' => "Tout le monde",
+ 'text' => "Tout le monde",
],
'prospects' => [
'slug' => 'prospects',
'text' => "Liste d'envoi quotidien"
],
'louis' => [
- 'slug' => 'louis',
- 'builder' => User::where('email', 'louis.jeckel@outlook.com')
- ->orWhere('email', 'admin@prescription-quotidien.com'),
- 'text' => 'Louis (test)',
+ 'slug' => 'cube',
+ 'builder' => User::where('email', $test),
+ 'text' => 'Test Fluidbook (test)',
],
'admin' => [
'slug' => 'admin',
- 'builder' => User::where('email', 'louis.jeckel@outlook.com')
- ->orWhere('email', 'admin@prescription-quotidien.com')
- ->orWhere('email', 'olivier.robichon@prescription-quotidien.com'),
+ 'builder' => User::whereIn('email', [$test, 'admin@prescription-quotidien.com', 'olivier.robichon@prescription-quotidien.com']),
'text' => 'Administrateurs (test)',
],
*/
public function sendGroupList()
{
- return response()->json(array_map(function($group) {
+ return response()->json(array_map(function ($group) {
$group['count'] = $group['builder']->count();
unset($group['builder']);
$group['text'] .= " ({$group['count']})";
}
-
-
-
}
'title' => 'Lettres publiƩes',
'route' => 'admin.publish.pdfFiles.index'
],
+ 'emailBatches' => [
+ 'title' => 'Stats',
+ 'module' => 'admin.publish.emailBatches',
+ ],
]
]
],
- 'stats' => [
- 'title' => "Stats",
- 'route' => 'emailBatches.index',
- 'module' => true,
- 'primary_navigation' => [
- 'emailBatches' => [
- 'title' => 'Campagnes email',
- 'module' => true,
- ],
-// 'prospects' => [
-// 'title' => 'Rapports de prospection',
-// 'route' => 'admin.stats.prospects'
-// ]
- ]
- ]
+
];