PHPackages                             pluswerk/mail-logger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. pluswerk/mail-logger

ActiveTypo3-cms-extension[Mail &amp; Notifications](/categories/mail)

pluswerk/mail-logger
====================

Mail Logger by anders und sehr GmbH

6.1.0(2w ago)859.0k↓53.6%8GPL-2.0-or-laterPHPPHP ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Feb 16Pushed 1w ago8 watchersCompare

[ Source](https://github.com/andersundsehr/mail_logger)[ Packagist](https://packagist.org/packages/pluswerk/mail-logger)[ Docs](https://www.andersundsehr.com/)[ RSS](/packages/pluswerk-mail-logger/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (32)Versions (61)Used By (0)

[![Packagist Release](https://camo.githubusercontent.com/750ec4eda3968ec360dd5fe8b0c71979b4f4e32d20ac448dd73eaac055e76f74/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706c75737765726b2f6d61696c2d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/pluswerk/mail-logger)[![GitHub License](https://camo.githubusercontent.com/0359d1a9c28cc0e9b4aeb91c9b1fa9b455f197652d6c73416b1a7b2d2bf2029f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616e64657273756e64736568722f6d61696c5f6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://github.com/andersundsehr/mail_logger/blob/master/LICENSE.txt)

EXT:mail\_logger by anders und sehr GmbH
========================================

[](#extmail_logger-by-anders-und-sehr-gmbh)

This is a TYPO3 extension with some mail functions:

1. [E-mail logging](#1-e-mail-logging)
2. [E-mail templates](#2-e-mail-templates)

Extension installation
----------------------

[](#extension-installation)

Install via composer or just copy the files into the TYPO3 extension folder:

```
composer require pluswerk/mail-logger
```

1. E-mail logging
-----------------

[](#1-e-mail-logging)

The extension automatically logs all outgoing mails of the TYPO3 system that are sent via the TYPO3 mail API. Just install the extension and it works. All outgoing mails can be found in the backend module of this TYPO3 mail logger.

The backend module can filter the mail log by recipient, sender, subject, and status. Filters can be combined, for example to show only mails that were not sent.

By default the maximum logging time of e-mails is 30 days and can be changed as follows: [see strtotime](http://php.net/manual/en/function.strtotime.php#refsect1-function.strtotime-examples)The mails will be anonymized after 7 days by default. This can be changed to anonymize them immediately by setting `anonymizeAfter` to `0`.

```
module.tx_maillogger.settings.cleanup {
  lifetime = 30 days
  anonymize = 1
  anonymizeAfter = 7 days
}
```

2. E-mail templates
-------------------

[](#2-e-mail-templates)

You can configure TYPO3 e-mail templates, written in Fluid, which are editable from editors (in the database) and configured via TypoScript (in VCS).

*How does this work?*E-mails will be basically configured in a TypoScript configuration (configuration of the sender address for example). Afterwards a database entry will be generated from the editor, which extends this template with additional information (fluid template or receiver for example). The instance of such an e-mail can be extended or overridden afterwards via PHP in your own extension (for example: a dynamic receiver).

### TypoScript example

[](#typoscript-example)

You always have to create a TypoScript template for a mail. The "label" is the only required field; the other fields are optional.

```
# E-mail template
module.tx_maillogger.settings.mailTemplates {
    exampleMailTemplateKey {
        label = This Label will be shown in the Backend for BE-Users, replace this with a good title! :-)
        mailFromName = Default Mail-From-Name
        mailFromAddress = info@domain.com
        mailToNames = Markus Hoelzle, John Doe
        mailToAddresses = markus-hoelzle@example.com, john.doe@example.com
        mailBlindCopyAddresses = we-read-all-your-mails@example.com
    }
}

```

### E-mail templates in database

[](#e-mail-templates-in-database)

E-mail templates will be stored in the database. Just create a record "E-mail template". The TypoScript template will be selected there. The message will be rendered by Fluid, so it is possible to print variables or use ViewHelpers.

##### Example message:

[](#example-message)

```

  Hello,

  we have {amount} new purchase keys (see attachment).

  This mail was sent automatically by domain.com

```

### Sending e-mails via PHP

[](#sending-e-mails-via-php)

##### Basic sample

[](#basic-sample)

```
