Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/jozan/themosis-mailgun-wrapper

A simple Mailgun wrapper for Themosis Framework
https://github.com/jozan/themosis-mailgun-wrapper

Last synced: 30 days ago
JSON representation

A simple Mailgun wrapper for Themosis Framework

Awesome Lists containing this project

README

        

# themosis-mailgun-wrapper
A simple Mailgun wrapper for [Themosis Framework](http://framework.themosis.com/).

### Quick Setup

Open up `.env.*.php` in your project root and add the following lines at the end of array:

```php
'MAILGUN_KEY' => 'your mailgun key',
'MAILGUN_DOMAIN' => 'your mailgun domain',
```

### Example usage

```php
// Somewhere in your php code...

use Latehours\Mailgun\Mail;

$mail = new Mail();

$message = ['greeting' => 'Thanks for registering!'];

// 'emails.greeting' is a Scout template
// $message is an array passed to the view
$mail->send('emails.greeting', $message, [
'from' => 'Admin ',
'to' => 'Awesome Dude ',
'subject' => 'Thanks for registering!'
]);
```
Example view `views/emails/greeting.scout.php`:
```php
{{ $greeting }}
```