Phtemail
Php Html Email Builder
PHP Email HTML Builder

Phtemail

Php Html email builder

Build Status Scrutinizer Code Quality Latest Stable Version License Total Downloads

Wanting to send html emails from some apps, I have used some times email templates edited by hand, meaning needing to look into boring html table structure from an extisting template, hard code the email content, or place some tags to be replaced later with real content by the code that needs to retreive the template, search replace tags, etc... That's so boring

Kristuff\Phtemail lets you create your template on the fly. Then, you are free to save it or send it immediately. The library comes with a centered layout, custom html elements for layout and email content, predefined styles, and methods / ways to customize the email as you need.

Demo

Check out the demo here: demo

Requirments

  • PHP >= 7.1
  • Composer (for install)

Install

  • Install with composer:

    $  composer require kristuff/phtemail
    
  • Or deploy in your project (in composer.json):

    {
        "require": {
            "kristuff/phtemail": ">=0.1-stable"
        }
    }
    

Sample

Basic sample:

<?php
require_once '../vendor/autoload.php';

use Kristuff\Phtemail\HtmlEmailBuilder;
use Kristuff\Phtemail\HtmlElements;

// Create a new instance an HtmlEmailBuilder 
$builder = new HtmlEmailBuilder();

//todo

// Get the generated email
email = $builder->getHtml();

Licence

MIT License

Copyright (c) 2017-2020 kristuff

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.