bronanza/laravel-emailer
This package provides abstraction for sending email
30
Larablocks Analysis
bronanza/laravel-emailer works with Laravel 5 (latest release 0.1.0, Jan 16, 2017), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Jan 16, 2017)
- 0 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Jan 16, 2017.
- No releases in the last 12 months.
- First released: Jan 16, 2017.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.
| Install | |
|---|---|
composer require bronanza/laravel-emailer |
|
| Latest Version: | 0.1.0 |
| PHP: | >=5.5.9 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Jan 16, 2017 |
| Links: | GitHub · Packagist |
Maintainer: erickkur
#laravel-emailer
laravel-emailer add a way to
Installation
- To install laravel-ongkir, add the following line to composer.json. Then run composer update:
"bronanza/laravel-emailer": "dev-master"
- Add the following code to the AppServiceProvider.php
public function register()
{
$this->app->singleton(
'Bronanza\Emailer\Contracts\Emailer',
'Bronanza\Emailer\LaravelEmailer'
);
}
Usage
- Make a class that contain the confifuration for the email
<?php
namespace App\Http\Controllers;
use Illuminate\Mail\Message;
use Bronanza\Emailer\Contracts\Email;
use App\User;
class UserEmail implements Email
{
/**
* Show the profile for the given user.
*
* @param int $id
* @return Response
*/
public function __construct(User $user)
{
$this->user = $user;
}
// View that will be used for the email
public function template()
{
return 'email.email-test';
}
// Data that will be used in the view
public function templateData()
{
return [
'user' => $this->user,
];
}
public function setup()
{
return function (Message $message) {
$customerSupport = [
'email' => 'apeng@example.com',
'name' => 'apeng'
];
$subject = 'Test Sending Email';
return $message
->from($customerSupport['email'], $customerSupport['name'])
->to($this->user->email, $this->user->first_name)
->bcc($customerSupport['email'])
->subject($subject);
};
}
}
<?php
namespace App\Http\Controllers;
use App;
use App\User;
use App\Http\Controllers\Controller;
use Bronanza\Emailer\Contracts\Emailer;
use App\Http\Http\Controller\UserEmail;
class SendEmail
{
protected $emailer;
/**
* instantite the emailer interface
**/
public function __construct(Emailer $emailer)
{
$this->emailer = $emailer;
}
public function index()
{
// Create a new Email object that contains the configuration
$email = App::make('App\Http\Controllers\UserEmail');
// Send the email
$this->emailer->send($email);
}
}
Related Packages
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.1.0 | >=5.5.9 | ~5.0 | MIT |