All Projects → jdtsoftware → laravel-email-templates

jdtsoftware / laravel-email-templates

Licence: other
Laravel 5 database driven email templates

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-email-templates

two-factor-authentication
Two Factor Authentication for Laravel
Stars: ✭ 21 (-8.7%)
Mutual labels:  laravel-5-package
ProvToolbox
Java library to create and convert W3C PROV data model representations
Stars: ✭ 62 (+169.57%)
Mutual labels:  templates
laravel-hijri-dates
Hijri dates for Laravel
Stars: ✭ 25 (+8.7%)
Mutual labels:  laravel-5-package
temply
@temply_bot Telegram bot repository
Stars: ✭ 20 (-13.04%)
Mutual labels:  templates
macaw
🦜 Scalable email templates for Node.js applications.
Stars: ✭ 24 (+4.35%)
Mutual labels:  templates
machine-learning-templates
Template codes and examples for Python machine learning concepts
Stars: ✭ 40 (+73.91%)
Mutual labels:  templates
techdocs
Accord Project Documentation
Stars: ✭ 48 (+108.7%)
Mutual labels:  templates
section-matter
Like front-matter, but allows multiple sections in a single document.
Stars: ✭ 18 (-21.74%)
Mutual labels:  templates
dotnet-new-nunit
Project is being maintained by the .NET Team now
Stars: ✭ 33 (+43.48%)
Mutual labels:  templates
grafana-dashboards
Collection of reusable Grafana dashboards
Stars: ✭ 55 (+139.13%)
Mutual labels:  templates
laravelmanthra
Laravel Crud Generator, I have working for years and I can tell you... It's all CRUD 💩💩💩
Stars: ✭ 27 (+17.39%)
Mutual labels:  laravel-5-package
Laravel-Aramex-SDK
Aramex open source Laravel SDK to integrate with Aramex API's
Stars: ✭ 22 (-4.35%)
Mutual labels:  laravel-5-package
Static-Sort
A simple C++ header-only library for fastest sorting of small arrays. Generates sorting networks on compile time via templates.
Stars: ✭ 30 (+30.43%)
Mutual labels:  templates
Friendships
a package for Friendships system
Stars: ✭ 45 (+95.65%)
Mutual labels:  laravel-5-package
laravel-two-factor-authentication
A two-factor authentication package for Laravel >= 8
Stars: ✭ 37 (+60.87%)
Mutual labels:  laravel-5-package
twoeg
🐣 Implementiert Twig-Templates für REDAXO
Stars: ✭ 23 (+0%)
Mutual labels:  templates
shaka-php
🎞 Shaka PHP is a library that uses Shaka Packager for DASH and HLS packaging and encryption, supporting Common Encryption for Widevine and other DRM Systems.
Stars: ✭ 63 (+173.91%)
Mutual labels:  laravel-5-package
smart-github
A chrome extension to further upgrade github's template
Stars: ✭ 17 (-26.09%)
Mutual labels:  templates
flash
An easy way for Laravel flash notifications.
Stars: ✭ 14 (-39.13%)
Mutual labels:  laravel-5-package
dotfiles
These are my dotfiles. All the config stuff that I use is here.
Stars: ✭ 16 (-30.43%)
Mutual labels:  templates

StyleCI

Laravel Email Templates

Database driven email templates for >= Laravel 5.4 and PHP 7.

Configuration

First register the service provider in config/app.php:

'providers' => [
    # ...
    JDT\LaravelEmailTemplates\ServiceProvider::class,
],

Then, in the same file, add the facade to the aliases config:

'aliases' => [
    # ...
    'EmailTemplate' => JDT\LaravelEmailTemplates\Facades\EmailTemplates::class,
]

Next, run the migrations:

$ php artisan migrate

This will set up 2 tables; email_template and email_layout.

Usage

The package is built in such a way that it plays nicely with the existing Laravel Mailer functionality.

Given a template existing in the above table with the handle 'registration', email can be sent simply as below:

$mail = \EmailTemplate::fetch('registration', ['name' => 'Jon']);
 
\Mail::to('[email protected]', $mail);

You can of course pass the language to translate the chosen email, providing you have created an email for that handle/language combination.

$mail = \EmailTemplate::fetch('registration', ['name' => 'Jon'], 'es');
 
\Mail::to('[email protected]', $mail);

This package doesn't rely on a templating engine such as Blade or Twig to handle any of the email messages, but does provide it's own view class adhering to Laravel contracts.

This means that you can pass data to the email just as you would any other view, without having to worry about the choice of templating package you use elsewhere in your project.

$mail = \EmailTemplate::fetch('registration', ['first_name' => 'Jon']);
 
$mail->with('last_name', 'Braud');
 
$mail->with([
    'verify_url'=> 'https:/....',
    'signup_time' => \Carbon\Carbon::now()->toDateTimeString()
]);
 
\Mail::to('[email protected]', $mail);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].