GithubHelp home page GithubHelp logo

atomjoy / proton Goto Github PK

View Code? Open in Web Editor NEW
19.0 1.0 4.0 3.92 MB

How to send HTML email using Laravel. HTML email templates for Laravel with blade components. HTML email footer signature in Laravel.

Home Page: https://github.com/atomjoy/proton

PHP 10.04% Blade 39.66% HTML 50.30%
blade-email-template html-email-template laravel-email-template proton-email-template html-email-templates laravel-email laravel-html-email laravel-html-emails laravel-emails email-signature

proton's Introduction

Proton html email template

Laravel proton html email template blade components.

Install package

composer create-project laravel/laravel:^10.0 email-app
cd email-app
composer require atomjoy/proton

Send email example

<?php
use App\Models\User;
use Proton\Mail\DefaultMail;
use Proton\Mail\RegisterMail;
use Proton\Mail\PasswordMail;
use Proton\Mail\F2aMail;

Route::get('/proton', function () {
  // User (required columns: id, name, code)
  // $user = User::first();

  $user = User::factory(1)->make([
    'email' => '[email protected]'
  ])->first();

  // Send email sample
  Mail::to('[email protected]')->send(new DefaultMail());

  // User reset password, use null for example
  Mail::to('[email protected]')->send(new PasswordMail($user, '321-XXX-123'));
  Mail::to('[email protected]')->locale('pl')->send(new PasswordMail($user, '321-XXX-123'));

  // User activation link (User model required columns: id, name, code), use null for example
  Mail::to('[email protected]')->send(new RegisterMail($user));
  Mail::to('[email protected]')->locale('pl')->send(new RegisterMail($user));

  // Code email
  Mail::to('[email protected]')->send(new F2aMail($user, 888777));
  Mail::to('[email protected]')->locale('pl')->send(new F2aMail($user, 888777));

  // Show example email view
  return view('proton::email.default');
  // return view('proton::email.password');
  // return view('proton::email.register');
  // return view('proton::email.signature');
  // return view('proton::email.f2a', ['user' => $user, 'password' => 888777]);
});

Edit email templates

# Edit package email views in resources/views/vendor/proton
php artisan vendor:publish --tag=proton-views --force

# Edit translations (optional)
php artisan vendor:publish --tag=proton-lang --force

# Copy images (optional)
php artisan vendor:publish --tag=proton-mail --force

# Create config file (optional)
php artisan vendor:publish --tag=proton-config --force

Create Laravel mail class

# Or create your own mail class
php artisan make:mail PromoMail

Email images

Example email

Activation email

Password email

2FA email

Html email signature image

LICENSE

This project is licensed under the terms of the GNU GPLv3 license.

proton's People

Contributors

atomjoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.