Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/megaads-vn/memail


https://github.com/megaads-vn/memail

Last synced: 10 days ago
JSON representation

Awesome Lists containing this project

README

        

# Laravel 5 Memail
This package for send multiple email in laravel 5
## Install and Configuration
Using composer command
```
composer require megaads/memail
```
After composer install package complete, open file app.php and add below line to `providers`:
```
Megaads\Memail\MemailServiceProvider::class
```
After, add to botton file ``config/mail.php``. It see like this:

```

'config-send-email' => [
'default' => [
'to' => ['[email protected]', '[email protected]'],
'subject' => 'Subject default',
'name' => 'Name default'
],
'groups' => [
'developers' => ['[email protected]', '[email protected]'],
'managers' => ['[email protected]', '[email protected]']
]
]

```

Then, config mail info in file ``.env``. It see like this:

```

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls

```

Finally, to call function send email, add this line:
```
use Megaads\Memail\Services\EmailService;
```
and call:
```
EmailService::send($option);
```

``$option`` is array, example:
```
[
'to' => ['first email', 'second email'],
'view' => 'emails.hello', // or 'content' => $content
'data' => $data, // pass to $dataEmail in view
'subject' => 'subject',
'group' => 'developers',
'name' => 'sender name'
]
```