formatd/mailer

Wrapper for Swiftmailer in Neos Flow Projects

Installs: 6 891

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 2

Type:neos-package

v1.1.11 2023-11-14 08:14 UTC

This package is auto-updated.

Last update: 2024-10-14 10:16:46 UTC


README

A Template Mailer for Neos Flow or/and CMS Projects.

What does it do?

This package provides a service class intended to be used as base class for sending fusion templates as mails. In addition it counatins a debugging aspect for cutting off and/or redirecting all mails (sent by Swiftmailer) in a development environment.

Kompatiblität

Versioning scheme:

 1.0.0 
 | | |
 | | Bugfix Releases (non breaking)
 | Neos Compatibility Releases (non breaking except framework dependencies)
 Feature Releases (breaking)

Releases und compatibility:

Using the service in you own plugins to use fluid templates for mails

Configure default from address:

FormatD:
  Mailer:
    defaultFrom:
      address: 'example@example.com'
      name: 'Example'

Extend AbstractMailerService and add methods as needed following the example of sendTestMail().

intersept all mails in a dev environment

Configure swiftmailer to intersept all mails send by your neos installation (not only by the service).

This is an example which intercepts all mails and redirects them to example@example.com and secondexample@example.com:

FormatD:
  Mailer:
    interceptAll:
      active: true
      recipients: ['example@example.com', 'secondexample@example.com']
    bccAll:
      active: false
      recipients: []

Handling Embedded Images

The method AbstractMailerService->setMailContentFromStandaloneView() has a parameter to embed all images into the mail body. This is handy if you have an installation that is protected by a .htaccess file for example, or the user may not have access to the internet when reading the email. GMail also cannot display images if they are included from a local domain.

FormatD.Mailer can be configured to replace all image urls by local paths (if you specify a baseUrl in your flow configuration). This is needed it the server cannot make a web-request to itself (also maybe due to a .htaccess or something).

FormatD:
  Mailer:
    localEmbed: true

Disable embed for specific images

You can disable image embedding for specific images by adding data-fdmailer-embed="disable" as data attribute to the image tag. This is useful for tracking pixels where you dont want the local embedding.