Download the PHP package fab/messenger without Composer

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


Messenger Extension

Messenger Extension is a TYPO3 extension for listing recipients in a flexible way and send them emails to them. The extension basically contains:

Project info and releases

Development version: https://github.com/fabarea/messenger.git

composer require fab/messenger

Flash info about latest development or release http://twitter.com/fudriot

Installation

Extension have self-explanatory settings in the Extension Manager. For a particular context you could configure to have all emails redirected to a configured email for testing purposes and for not "leaking" messages outside your dev environment.

Message composing

When composing content, you can take full advantage of the Fluid syntax and make use of View Helper within your messages. Markers should be defined as follows `{first_name}` and will be processed when rendering the email.

Note, you can use a double curly bracket `{{text}}` to have the marker interpreted as HTML. This would be the equivalent to `<f:format.raw>{text}</f:format.raw>` in Fluid.

You may want to add prefix to all URLs with a domain (absolute URLs) which is required to have the links clickable. Otherwise, links will be relative to nothing and this will simply not work correctly for the end user.

Retrieve sent messages

It could be handy to show sent messages or messages from the queue on the FE. We can achieve that knowing the UUID of the message. In newsletter we often have see links like ""

This can be used in a HTML content element in TYPO3 to generate a link to show the content that was sent to the User in the browser.

Message API

Usage:

$templateIdentifier = 1; // uid
$layoutIdentifier = 1; // uid
$recipients = array('[email protected]' => 'John Doe');
$markers = array(
  'first_name' => 'John',
  'last_name' => 'Doe',
);
$languageIdentifier = 0; // sys_language_uid
$pathToFile = 'some-path-to-file'; // @todo replace me with FAL identifier

/** @var \Fab\Messenger\Domain\Model\Message $message */
$message = GeneralUtility::makeInstance(Fab\Messenger\Domain\Model\Message:class);

# Minimum required to be set
$message->setMessageTemplate($templateIdentifier)
	->setTo($recipients);

# Additional setter
$message->assign('foo', $bar)
	->setLanguage($languageIdentifier)
	->addAttachment($pathToFile)
	->setMessageLayout($layoutIdentifier);

# Send the email...
$isSent = $message->send();

Queue

Messenger has the feature to queue up emails. This is advised as soon as sending many emails at once.

/** @var \Fab\Messenger\Domain\Model\Message $message */
$message = GeneralUtility::makeInstance('Fab\Messenger\Domain\Model\Message');
$message->
	... // same as in the example above
	->enqueue();

Configuration

Following configuration should be configured. The default sender name:

$GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromName'] = 'John Doe';
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'] = '[email protected]';

Whenever Application Context is in Development, there is the possibility to define a default target recipient which is convenient for sending unwanted emails to real people.

$GLOBALS['TYPO3_CONF_VARS']['MAIL']['development']['recipients'] = '[email protected]';

Tool to send emails to Frontend Users

Messenger makes it possible to send bulk messages to a selection / group of users. There is BE module to see the state of the queue and the messages waiting to be sent. Consider setting up the scheduler task to properly send the emails as messages are put into a queue and are sent by patch.

You have the possibility to configure a list of possible senders (the contact person displayed as "from"). They could be retrieved from three different sources

CLI

Messenger provides two commands.

Send messages and remove them from the queue by batch of 100 messages:

./vendor/bin/typo3 messenger:dequeue

Sent messages older than 100 days will be removed:

./vendor/bin/typo3 messenger:cleanUp

Fluid templates

More of Fluid's power can be used if the template is stored in external files. In such a case layouts can be used. They have to be stored in a folder called "Layouts", placed in the same folder as the template itself.

For example, if the template is located at "EXT:foo/Resource/Private/Templates/Mail/Bar.html" it may refer to layouts located in "EXT:foo/Resource/Private/Templates/Mail/Layouts".

Furthermore, it is possible to choose "Fluid only" as a templating engine when defining a message template. In such a case the Markdown interpreter will not run. This means that the Fluid template can be written more freely.

Sponsors


All versions of messenger with dependencies

PHP Build Version
Package Version
Requires typo3/cms-core Version ^11.0
fab/vidi Version *
michelf/php-markdown Version ^1.9
php Version ^8.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 fab/messenger contains the following files

Loading the files please wait ....