namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
+use App\Notifications\NewTrialUser;
use App\Providers\RouteServiceProvider;
use App\User;
use \Illuminate\Database\Query\Builder;
]
);
+ //If users requested a trial period
+ if($type === User::TYPE_DISCOVER) {
+ \Notification::route('mail', config('app.emails.subscriptions'))
+ ->notify(new NewTrialUser($user));
+ }
+
return $user;
}
$contactRequest = new ContactRequest($request->all());
$contactRequest->save();
- \Notification::route('mail', 'olivier.robichon@prescription-quotidien.com')
+ \Notification::route('mail', config('app.emails.olivier'))
->notify(new \App\Notifications\ContactRequest($contactRequest));
\Session::flash('message', "Votre demande a bien été prise en compte, nous reviendrons vers vous dans les plus brefs délais. Merci de l'intérêt que vous portez à Prescription Santé - Le Quotidien !");
--- /dev/null
+<?php
+
+namespace App\Notifications;
+
+use App\User;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Notifications\Messages\MailMessage;
+use Illuminate\Notifications\Notification;
+
+class NewTrialUser extends Notification
+{
+ use Queueable;
+
+ /**
+ * @var User
+ */
+ private User $user;
+
+ /**
+ * Create a new notification instance.
+ *
+ * @param User $user
+ */
+ public function __construct(User $user)
+ {
+ $this->user = $user;
+ }
+
+ /**
+ * Get the notification's delivery channels.
+ *
+ * @param mixed $notifiable
+ * @return array
+ */
+ public function via($notifiable)
+ {
+ return ['mail'];
+ }
+
+ /**
+ * Get the mail representation of the notification.
+ *
+ * @param mixed $notifiable
+ * @return \Illuminate\Notifications\Messages\MailMessage
+ */
+ public function toMail($notifiable)
+ {
+ return (new MailMessage)
+ ->greeting('')
+ ->subject("{$this->user->name} à fait une demande de période découverte.")
+ ->line("{$this->user->name} à fait une demande de période découverte.")
+ ->action("Accéder au CRM", "https://admin.prescription-quotidien.com/crm");
+
+ }
+
+ /**
+ * Get the array representation of the notification.
+ *
+ * @param mixed $notifiable
+ * @return array
+ */
+ public function toArray($notifiable)
+ {
+ return [
+ //
+ ];
+ }
+}
'aws_s3_url' => 'https://prescription-sante.s3.eu-west-3.amazonaws.com',
- 'version' => '0.6.1 beta 4',
+ 'version' => '0.6.2 beta 4',
+
+ 'emails' => [
+ 'subscriptions' => 'abonnement@prescription-quotidien.com',
+ 'olivier' => 'olivier.robichon@prescription-quotidien.com',
+ ],
/*
/** Dynamic content */
Route::prefix('content')->group(function() {
Route::module('pdfFiles');
- Route::module('articles');
+// Route::module('articles');
Route::module('adCampaigns');
Route::module('events');
Route::module('podcasts');
Route::module('laboArticles');
Route::module('weeklyAgendas');
- Route::module('eventImages');
+// Route::module('eventImages');
Route::module('humeurs');
Route::module('guests'); //podcast guests