Skip to content

Commit 1723abe

Browse files
committed
ajout de l'envoie de notification apres soumission et validation d'article
1 parent 719133d commit 1723abe

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace App\Notifications;
4+
5+
use App\Models\Article;
6+
use Illuminate\Bus\Queueable;
7+
use Illuminate\Notifications\Messages\MailMessage;
8+
use Illuminate\Notifications\Notification;
9+
10+
class SendApprovedArticle extends Notification
11+
{
12+
use Queueable;
13+
14+
public function __construct(public Article $article)
15+
{
16+
}
17+
18+
public function via($notifiable): array
19+
{
20+
return ['mail'];
21+
}
22+
23+
/**
24+
* Get the mail representation of the notification.
25+
*
26+
* @param mixed $notifiable
27+
* @return \Illuminate\Notifications\Messages\MailMessage
28+
*/
29+
public function toMail($notifiable)
30+
{
31+
return (new MailMessage)
32+
->subject('Article Approuvé 🎉.')
33+
->greeting('Article Approuvé 🎉.')
34+
->line('Merci d\'avoir soumis votre article pour créer du contenu au sein de Laravel Cameroun.')
35+
->action('Voir mon article', route('articles.show', $this->article))
36+
->line('Merci d\'avoir utilisé Laravel Cameroun.!');
37+
}
38+
}

app/Notifications/SendEMailToDeletedUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public function toMail($notifiable)
3535
->line('Pour des raisons de validité et d\'authenticité de votre adresse email')
3636
->line('Nous avons supprimé votre compte après 10 jours d\'inscription sans validation de votre adresse email.')
3737
->line('Nous ne pouvons donc pas authentifier que cette adresse email est belle et bien utilisée.')
38-
->line('Merci d\'avoir utilise Laravel Cameroun!');
38+
->line('Merci d\'avoir utilisé Laravel Cameroun!');
3939
}
4040
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
namespace App\Notifications;
4+
5+
use App\Models\Article;
6+
use Illuminate\Bus\Queueable;
7+
use Illuminate\Notifications\Messages\MailMessage;
8+
use Illuminate\Notifications\Notification;
9+
10+
class SendSubmittedArticle extends Notification
11+
{
12+
use Queueable;
13+
14+
public function __construct(public Article $article)
15+
{
16+
}
17+
18+
public function via($notifiable): array
19+
{
20+
return ['mail'];
21+
}
22+
23+
/**
24+
* Get the mail representation of the notification.
25+
*
26+
* @param mixed $notifiable
27+
* @return \Illuminate\Notifications\Messages\MailMessage
28+
*/
29+
public function toMail($notifiable)
30+
{
31+
return (new MailMessage)
32+
->subject('Nouvelle soumission d\'article')
33+
->greeting('Bonjour Admin!')
34+
->line("Un nouvel article a été soumis par {$this->article->author->name}")
35+
->action('Afficher l\'article', route('articles.show', $this->article))
36+
->line('Merci d\'avoir utilisé Laravel Cameroun!');
37+
}
38+
}

0 commit comments

Comments
 (0)