Download the PHP package sandstorm/templatemailer without Composer

On this page you can find all versions of the php package sandstorm/templatemailer. 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 templatemailer

Sandstorm.TemplateMailer - Simple Template-Based Emails for Neos and Flow

Features

This package works in Neos CMS and Flow and provides the following functionality:

Compatibility and Maintenance

Sandstorm.TemplateMailer is currently being maintained for the following versions:

Neos / Flow Version Sandstorm.TemplateMailer Version Maintained
Flow 8.x 2.x Yes
Flow 6.x, Flow 7.x 2.x Yes
Neos 4.x, Flow 5.x 1.x Yes
Neos 3.x, Flow 4.x 1.x Yes

Configuration and Usage

Configuring SwiftMailer

The TemplateMailer package requires SwiftMailer to send out e-mails. Please check the swiftmailer package's configuration options (https://github.com/neos/swiftmailer) in order to configure SMTP credentials.

Configuring the package

This package provides 2 config options.

Configuring global sender addresses

By adding entries to the senderAddresses config array, you can define sender addresses in your config and connect them to a string identifier. This allows for easy global maintenance of email sender addresses and names. Override the "default" entry to just have one global sender address that's automatically used everywhere without you having to do anything else.

Configuring global reply to addresses

By adding entries to the replyToAddresses config array, you can define reply to addresses in your config and connect them to a string identifier. This allows for easy global maintenance of email reply to addresses and names. By default, no reply to address is used. To set a reply to address on the mail, you need to specify the reply to address key as method argument of sendTemplateEmail.

Configuring template source packages

You need to tell TemplateMailer in which packages it should look for email templates. Do this by adding an entry to the templatePackages array, like so:

If you have multiple packages that contain email templates, add them all in the order you want TemplateMailer to search them for templates. Lower numbers as keys mean that this package is checked earlier. If a template with the given name is found in a package, it is used. This way, you can create an override hierarchy.

Default Template Variables

You can expose configuration settings as default template variables to all email templates. We use this to expose the base Uri by default, but you can pass arbitrary settings paths here and they will be resolved.

Logging errors and sent mails

You can control how TemplateMailer handles errors and also successfully sent mails via the two parameters in logging. Via the "sendingErrors" config option, you can specifiy what templateMailer should do if the email could not be sent correctly. There are three options:

For "sendingSuccess", you can only select 'log' or 'none'. 'log' will insert a log entry for all sent emails. Since this can create lots of entries in your log file, use it for debugging/monitoring purposes only.

Using the package

Create an "EmailTemplates" folder in your package's Resources/Private folder. In it, create as many email templates as you want.

IMPORTANT: You must create a .txt and an .html file with the same name for each template-based mail you want to send.

You can use partials and layouts as usual in Fluid. If you do, put them in Resources/Private/EmailTemplates/Partials or Resources/Private/EmailTemplates/Layouts respectively.

Basic usage

A very basic usage without variables looks like this. Your template must not contain any variables (as you aren't passing in any) and TemplateMailer will use the "default" sender address, which you should configure beforehand.

Globally configured custom sender address

You can use a different configured sender address as well as pass variables to the template. You need to have configured the sender email 'mysender' before.

Dynamic sender address

If you pass an array to the sendTemplateEmail() method, we'll pass it right through to SwiftMailer so you can use sender email addresses that haven't been configured before.

CC, BCC and Attachments

You can also set cc, bcc and attachments. Here is a full example:


All versions of templatemailer with dependencies

PHP Build Version
Package Version
Requires neos/flow Version ^7.3 || ^8.0 || dev-main
neos/swiftmailer Version ^7.0
pelago/emogrifier Version ^6.0 || ^7.0
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 sandstorm/templatemailer contains the following files

Loading the files please wait ....