I want to generate an email report (email sent copy) as soon as the email sent to the user in Laravel using the Mail function below is the sample image for sent email
Asked
Active
Viewed 98 times
1
-
Hi & welcome to the SO. Please read this first [How to ask a question](https://stackoverflow.com/help/how-to-ask) and also this [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Igor Ilic Mar 11 '19 at 08:06
-
I used the below code to send the email Mail::to($request->input('test_email'))->send(new TestEmail($emailTemplate->content, $emailTemplate->subject)); and Created EventServiceProvider to log the same. protected $listen = [ 'Illuminate\Mail\Events\MessageSent' => [ 'App\Listeners\LogSentMessage', ] In LogSentMessage: EmailLog::create([ 'name' => $mailEvent->message->template_name, 'user_id' => $mailEvent->message->user_id, 'email_template_id' => $mailEvent->message->template_id, ]); – Sher Bahadur Mar 11 '19 at 09:20
1 Answers
0
you can send same mail using bcc
Blind Carbon Copy like this way :
Mail::to($request->user())
->bcc('secret mail')
->send(new OrderShipped($order));
so you can get exact copy of mail send to user , and bcc information is not visible to user.

Saurabh Mistry
- 12,833
- 5
- 50
- 71
-
Thanks for responding Saurabh, Is there is any way to get the report(sent email) on pdf as I am receiving an email if I used Bcc I want to store in our application and save the report into the database as well. – Sher Bahadur Mar 11 '19 at 09:24