Laravel-Mailer-Class 0

A simple Laravel mailer class

3 years after

Laravel Mailer Class

A simple Laravel mailer class

You can use this as you wish, just a simple class to help cleanup code and send mail.

The best way to use is either type-hint from your method:

public function store(AppMailer $mailer)
{
  // Do some stuff
  // pass the user object through, do whatever you want here

  // Send email
  $mailer->sendEmailConfirmationTo($user);
  return back(); // Whatever you like
}

or via your constructor method like so and I store in app/Mailers

use App\Mailers\AppMailer;

 /**
 * @var AppMailer
 */
private $mailer;

/**
 * constructor.
 * @param AppMailer $mailer
 */
public function __construct(AppMailer $mailer)
{
    $this->mailer = $mailer;
}

Then just refer to $this->mailer->sendEmailConfirmationTo() or whatever methods you have within the mailer class.

Related Repositories

mailthief

mailthief

A fake mailer for Laravel Applications for testing mail. ...

awesome-laravel

awesome-laravel

A curated list of delightful Laravel PHP framework packages and resources ...

Laravel-4-AngularJS-Starter-Site

Laravel-4-AngularJS-Starter-Site

Laravel-4-AngularJS-Starter-Site ...

slim-services

slim-services

Service manager for Slim compatible with Laravel packages ...

Messages

Messages

A Laravel Bundle for the Swiftmailer library ...


Top Contributors

lstables marcusmoore alexryderwhytewaters mtdavidson