philtune / html-email-framework
PHP build tool for creating bullet-proof emails
dev-master
2022-02-01 18:45 UTC
Requires
- php: >=7.4.0
This package is auto-updated.
Last update: 2024-09-29 05:50:07 UTC
README
This is a framework for us to build out consistent, error-free emails. Still very much a work in progress. The goal is to not have to think about HOW to build a bulletproof email.
Initially authored by Phil Tune in Jan 2022.
Installation
$ git clone https://github.com/philtune-discovery/Email-Framework.git
Framework Directories and Bootstrapping
Inside /framework
are a few class directories and bootstrapping files.
App
- has a handful of generic, App framework utility methodsDOM
- dependency that manages building DOM elementsHTMLEmail
- abstracts a lot of coding blocks used specifically in email developmentStyles
- (todo) should manage options for painlessly managing and inserting stylesView
- nice utility class for loading view files and injecting dataautoloader.php
- generic class autoloader, (mostly) follows PSR-4 standardsbootstrap.php
- called by../index.php
for bootstrappingconsole.php
- currently just has a quick "dump and die" function calledjson_out()
definitions.php
- sets a bunch of required defaults for the apphelpers.php
- utility functions; this is also a good place to load any helper files found inside the class directories; helpers are more succinct ways to access class methods
Other Directories
config
- PHP files that should return a value, usually for storing data separate from application logic; useconfig('path')
(without the trailing.php
) to return the datadist
- nice place to store output and static files; you can change this inframework/definitions.php
views
- using theview('path', ['key'=>'val'])
helper will return files from here; also can be changed inframework/definitions.php
Usage
On /views/pages/home.php
:
use HTMLEmail\OLD\HTMLEmailz; echo HTMLEmailz::include('main'); // TODO - finish usage documentation
Contributing
Pull requests are welcome. As industry best practices and techniques (as well as our own unique needs) evolve, this framework can and should be updated.