2017 © Pedro Peláez
 

library mailer

Send mail in PHP with Laravel 5.

image

codezero/mailer

Send mail in PHP with Laravel 5.

  • Tuesday, July 12, 2016
  • by codezero
  • Repository
  • 3 Watchers
  • 2 Stars
  • 910 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Mailer

GitHub release License Build Status Scrutinizer Total Downloads, (*1)

Send mail in PHP (with Laravel 5 implementation).

Laravel 5 Installation

Install this package through Composer:, (*2)

composer require codezero/mailer

Add a reference to MailerServiceProvider to the providers array in config/app.php:, (*3)

'providers' => [
    'CodeZero\Mailer\MailerServiceProvider'
]

Usage

Create a new MailComposer class that extends CodeZero\Mailer\MailComposer., (*4)

<?php

namespace App;

use CodeZero\Mailer\MailComposer;

class WelcomeMailComposer extends MailComposer
{
    /**
     * Compose a welcome mail.
     *
     * @param string $email
     * @param string $firstname
     *
     * @return \CodeZero\Mailer\Mail
     */
    public function compose($email, $firstname)
    {
        $toEmail = $email;
        $toName = $firstname;
        $subject = 'Welcome!';
        $view = 'emails.welcome';
        $data = ['name' => $firstname];
        $options = null;

        return $this->getMail($toEmail, $toName, $subject, $view, $data, $options);
    }
}

You can accept any parameters you want in the compose() method (and actually name it whatever you like). The important part is that you call the getMail() method on the base class. This will return a CodeZero\Mailer\Mail object, that you use to send() the message., (*5)

// Make or inject your mail composer class
$mail = app()->make('App\WelcomeMailComposer');

// Compose and send
$mail->compose('example@example.com', 'Example Name')->send(); 

This will call Laravel's Mail::queue() behind the scenes., (*6)

Testing

$ vendor/bin/phpspec run

Security

If you discover any security related issues, please e-mail me instead of using the issue tracker., (*7)

License

The MIT License (MIT). Please see License File for more information., (*8)


Analytics, (*9)

The Versions

12/07 2016

dev-master

9999999-dev

Send mail in PHP with Laravel 5.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Ivan Vermeyen

laravel mail php message

12/07 2016

2.0.0

2.0.0.0

Send mail in PHP with Laravel 5.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Ivan Vermeyen

laravel mail php message

10/06 2015

1.0.0

1.0.0.0

Send mail in PHP with Laravel 5.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Ivan Vermeyen

laravel mail php message