2017 © Pedro Peláez
 

library mailer

Laravel 4 package for more efficient email sending inspired by Laracasts.

image

mabasic/mailer

Laravel 4 package for more efficient email sending inspired by Laracasts.

  • Saturday, June 6, 2015
  • by mabasic
  • Repository
  • 3 Watchers
  • 6 Stars
  • 215 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Mailer

Laravel 4 package for more efficient email sending inspired by Laracasts lessons:, (*1)

What does it exactly do?, (*2)

It enables you to write this:, (*3)

$this->contactMailer->send($data);

from your controller, instead of doing this:, (*4)

Mail::queue($view, $data, function($message) use($email, $subject)
{
    $message->to($email)->subject($subject);
});

every time you want to send an email., (*5)

Installation

From your project root type:, (*6)

composer require mabasic/mailer

Usage

Create a class for specific case like so:, (*7)

<?php namespace Acme\Mailers;

use Mabasic\Mailer\Mailer;

class ContactMailer extends Mailer {

    public function send($data)
    {
        $view = 'emails.contact';
        $subject = 'Test';
        $email = 'test@test.com';

        $this->sendTo($email, $subject, $view, $data);
    }

}

Then in your controller you can inject it and use it like so:, (*8)

<?php

use Acme\Mailers\ContactMailer;

class MailerController extends \BaseController {

    protected $contactMailer;

    function __construct(ContactMailer $contactMailer)
    {
        $this->contactMailer = $contactMailer;
    }

    public function sendMail()
    {
        // Get some data for the email, like user name, message, etc ...

        $data = [
            'name' => 'John Doe',
            'comment' => 'Hello, nice to meet you.'
        ];

        $this->contactMailer->send($data);

        return 'ok';
    }

}

The Versions

06/06 2015

dev-master

9999999-dev

Laravel 4 package for more efficient email sending inspired by Laracasts.

  Sources   Download

MIT

The Requires

 

laravel mail email mailer

06/06 2015

2.0.0

2.0.0.0

Laravel 4 package for more efficient email sending inspired by Laracasts.

  Sources   Download

MIT

The Requires

 

laravel mail email mailer

21/09 2014

1.1.2

1.1.2.0

Laravel package for more efficient email sending inspired by Laracasts.

  Sources   Download

MIT

The Requires

 

laravel mail email mailer

21/09 2014

1.1.1

1.1.1.0

Laravel package for more efficient email sending inspired by Laracasts.

  Sources   Download

MIT

The Requires

 

laravel mail email mailer

21/09 2014

1.1.0

1.1.0.0

Laravel package for more efficient email sending inspired by Laracasts.

  Sources   Download

MIT

The Requires

 

laravel mail email mailer

01/07 2014

1.0.0

1.0.0.0

Laravel package for more efficient email sending inspired by Laracasts.

  Sources   Download

MIT

The Requires

 

laravel mail email mailer