Link to home
Start Free TrialLog in
Avatar of Eduardo Fuerte
Eduardo FuerteFlag for Brazil

asked on

Could you point a Laravel library to send an email after an action?

Hi Experts

Could you point a Laravel library to send an email after an action?

After an user sends an image to be shown at a vitrine it must to be approved/ reproved by the admin and then an email must to be automatically sent to the user relating the result.

Thanks in advance
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Expanding on comment Chris made, start with a relay service like MailGun, for instant delivery.

Then as time permits, go through steps provides, if running your own in house MTA is required.
Avatar of Eduardo Fuerte


Hi Chris

Really... the site already uses the approach you had pointed...

What I had adpted is:


use App\Mail\FotoAprovada;
use Mail;

  try {
	$resultado=new Resultado(false,"","Foto aprovada com sucesso.");
   // Email 
	 try {
			->send(new FotoAprovada());
	} catch (\Exception $e){
		print ' - '.$e->getMessage().PHP_EOL;

Open in new window


Email text:

<title>Foto Aprovada</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<body bgcolor="#003366" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
		<td style="text-align:center;">
      <img alt="" src="https://XXXX/vitrines/a2bae276qw86e8q6q8we6q8e668qe68qe6e868qw686e2f3df.jpg"/>

Open in new window


namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class FotoAprovada extends Mailable
    use Queueable, SerializesModels;

     * Create a new message instance.
     * @return void
    public function __construct()

     * Build the message.
     * @return $this
    public function build()
        return $this->view('emails.fotoaprovada.index')->subject('XXXXXXXX - Foto Aprovada');

Open in new window


Thank you for the reply!
No worries Eduardo