Download the PHP package tatter/outbox without Composer

On this page you can find all versions of the php package tatter/outbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package outbox

Tatter\Outbox

Email toolkit for CodeIgniter 4

Coverage Status

Quick Start

  1. Install with Composer: > composer require tatter/outbox
  2. Prepare the database: > php spark migrate -all && php spark db:seed "Tatter\Outbox\Database\Seeds\TemplateSeeder"
  3. Send beautiful, dynamic email:

Features

Outbox supplies useful tools to supplement the framework's native Email class: logging, style inlining, and templating.

Installation

Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:

Or, install manually by downloading the source files and adding the directory to app/Config/Autoload.php.

Configuration (optional)

The library's default behavior can be altered by extending its config file. Copy examples/Outbox.php to app/Config/ and follow the instructions in the comments. If no config file is found in app/Config then the library will use its own.

If you plan to use the Template Routes (see below) you might also want to configure Tatter\Layouts to ensure the views are displayed properly for your app.

Usage

Logging

By default Outbox will log any successfully sent emails in the database. This provides a handy paper-trail for applications that send a variety of status and communication messages to users. Use the Tatter\Outbox\Models\EmailModel and its corresponding entity to view email logs.

Inlining

Sending HTML email can be tricky, as support for HTML and CSS vary across displays and devices. Outbox includes CssToInlineStyles, a module by tijsverkoyen to take any CSS and inject it inline into an email template for maximum compatibility. This allows you to reuse site stylesheets or write your own from scratch and use them across any of your templates. Use the default styles from Responsive HTML Email Template, supply your own as string parameters, or create a View file and add it to the configuration.

Templating

Outbox comes with a default template, a modified-for-CodeIgniter version of the Responsive HTML Email Template. This provides a solid basis for your emails so you can be sure they will display nicely on any device. Run the Template Seeder to begin using this as the default:

You may also write your own templates and seed them or use the provided MVC bundle for managing email templates in your database. To enable the Controller you will need to toggle $routeTemplates in the configuration, or add the following routes to app/Config/Routes.php:

Be sure to secure appropriate access to these routes (e.g. with a Filter).

Tokens

Templates use View Parser "tokens" that will be passed through to add your data. The Template Entity can do this for you by passing in your data parameters:

renderBody() will take care of inlining any CSS you have provided and including your template in its parent (if defined).

If you do not need any other configuration you can get a fully prepared version of the Email class with rendered and inlined content from the library:

Cascading Templates

Each Template may also be created with a "Parent Template". Parent templates need to have a {body} token which will receive the parsed content from its child. Additional tokens in the parent template can be entered by defining them in the child.

Cascading templates makes it easy to have a few "layouts" with many different variable messages for each layout. For example, your app may send both newsletters and receipts with their own layout (Parent Template) and then a myriad of different customizable messages for different occasions.


All versions of outbox with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
tatter/layouts Version ^1.0
tijsverkoyen/css-to-inline-styles Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tatter/outbox contains the following files

Loading the files please wait ....