{"id":31850125,"url":"https://github.com/andersundsehr/mail_logger","last_synced_at":"2026-02-23T10:17:56.728Z","repository":{"id":29423867,"uuid":"121644679","full_name":"andersundsehr/mail_logger","owner":"andersundsehr","description":"Mail Logger by anders und sehr GmbH - This TYPO3 extension Logs all send Mails.","archived":false,"fork":false,"pushed_at":"2025-09-12T08:39:40.000Z","size":296,"stargazers_count":6,"open_issues_count":1,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-13T23:26:56.246Z","etag":null,"topics":["hacktoberfest","mail","php","typo3","typo3-cms-extension","typo3-extension"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andersundsehr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-02-15T15:20:38.000Z","updated_at":"2025-09-12T08:42:54.000Z","dependencies_parsed_at":"2024-04-12T14:26:11.980Z","dependency_job_id":"4edba27a-c3cf-471c-aaee-6a7bdee026cd","html_url":"https://github.com/andersundsehr/mail_logger","commit_stats":{"total_commits":130,"total_committers":15,"mean_commits":8.666666666666666,"dds":0.7384615384615385,"last_synced_commit":"128b3e41209c7c9d3b7d500902cf45fd7e3f09da"},"previous_names":["andersundsehr/mail_logger","pluswerk/mail_logger"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/andersundsehr/mail_logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Fmail_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Fmail_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Fmail_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Fmail_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andersundsehr","download_url":"https://codeload.github.com/andersundsehr/mail_logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andersundsehr%2Fmail_logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011197,"owners_count":26084899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","mail","php","typo3","typo3-cms-extension","typo3-extension"],"created_at":"2025-10-12T11:17:33.002Z","updated_at":"2025-10-12T11:17:36.944Z","avatar_url":"https://github.com/andersundsehr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Packagist Release](https://img.shields.io/packagist/v/pluswerk/mail-logger.svg?style=flat-square)](https://packagist.org/packages/pluswerk/mail-logger)\n[![GitHub License](https://img.shields.io/github/license/andersundsehr/mail_logger.svg?style=flat-square)](https://github.com/andersundsehr/mail_logger/blob/master/LICENSE.txt)\n\n# EXT:mail_logger by anders und sehr GmbH\n\nThis is an TYPO3 extension with some mail functions:\n1. [E-mail logging](#1-e-mail-logging)\n2. [E-mail templates](#2-e-mail-templates)\n\n## Extension installation\n\nInstall via composer or just copy the files into the TYPO3 extension folder:\n\n```Shell\ncomposer require pluswerk/mail-logger\n```\n\nAdd the Typoscript files to your sites Typoscript:\n- add `@import 'EXT:mail_logger/Configuration/TypoScript/constants.typoscript'` in your constants\n- and `@import 'EXT:mail_logger/Configuration/TypoScript/setup.typoscript'` in your setup.\n\n## 1. E-mail logging\n\nThe extension automatically log all outgoing mails of the TYPO3 system, which 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.\n\nBy default the maximum logging time of e-mails is 30 days and can be changed as following:\n[see strtotime](http://php.net/manual/en/function.strtotime.php#refsect1-function.strtotime-examples)\nThe mails will be anonymized after 7 days by default. It can be changed to anonymize directly, by setting anonymizeAfter to 0.\n```ts\nmodule.tx_maillogger.settings.cleanup {\n  lifetime = 30 days\n  anonymize = 1\n  anonymizeAfter = 7 days\n}\n```\n\n## 2. E-mail templates\n\nYou can configure TYPO3 e-mail templates, written in Fluid, which are editable from editors (in the database) and configured via TypoScript (in VCS).\n\n*How does this work?*\nE-mails will be basically configured in a TypoScript configuration (configuration of the sender address for example).\nAfterwards a database entry will be generated from the editor, which extends this template with additional information (fluid template or receiver for example).\nThe instance of such an e-mail can be extended or overridden afterwards via php in your own extension (for example: dynamic receiver).\n\n### TypoScript example\n\nYou always have to create a TypoScript template for a mail. The \"label\" is the only required field, the orher fields are optional.\n\n```typo3_typoscript\n# E-mail template\nmodule.tx_maillogger.settings.mailTemplates {\n    exampleMailTemplateKey {\n        label = This Label will be shown in the Backend for BE-Users, replace this with a good title! :-)\n        mailFromName = Default Mail-From-Name\n        mailFromAddress = info@domain.com\n        mailToNames = Markus Hoelzle, John Doe\n        mailToAddresses = markus-hoelzle@example.com, john.doe@example.com\n        mailBlindCopyAddresses = we-read-all-your-mails@example.com\n    }\n}\n```\n\n### E-mail templates in database\n\nE-mail templates will be stored in the database. Just create a record \"E-mail template\". The TypoScript template will be selected there.\nThe message will be rendered by Fluid, so it is possible to print variables or use ViewHelpers.\n\n##### Example message: \n\n```html\n\u003cf:format.nl2br\u003e\n  Hello,\n  \n  we have {amount} new purchase keys (see attachment).\n  \n  This mail was sent automatically by domain.com\n\u003c/f:format.nl2br\u003e\n```\n\n### sending E-mails via PHP\n\nE-mail instances \"\\\\Pluswerk\\\\MailLogger\\\\Domain\\\\Model\\\\Mail\\\\TemplateBasedMailMessage\" inherit from SwiftMailer class \n\"\\\\Swift\\_Message\".\nTherefor an e-mail instance have got following functions:  \u003chttp://swiftmailer.org/docs/messages.html\u003e\nThe easiest way is to use the functions of the \"\\\\Pluswerk\\\\MailLogger\\\\Utility\\\\MailUtility\" class.\n\n##### basic sample:\n\n```php\n\u003c?php\nuse \\Pluswerk\\MailLogger\\Utility\\MailUtility;\nMailUtility::getMailByKey('exampleMailTemplateKey', null, ['myVariable' =\u003e 'This mail was sent at ' . time(), 'myUser' =\u003e $myExtbaseUser])-\u003esend();\n```\n\n#### E-mail template in certain language\n\n```php\n\u003c?php\nuse \\Pluswerk\\MailLogger\\Utility\\MailUtility;\nMailUtility::getMailByKey('exampleMailTemplateKey', 42, ['myVariable' =\u003e 'This mail was sent at ' . time(), 'myUser' =\u003e $myExtbaseUser])-\u003esend();\n```\n\n#### example - passing E-mail parameters and sending attachment (FPDF for example)\n\n```php\n\u003c?php\nuse \\Pluswerk\\MailLogger\\Utility\\MailUtility;\ntry {\n    // send mail\n    $mail = MailUtility::getMailByKey('exampleMailTemplateKey', null, [\n        'amount' =\u003e $amount\n    ]);\n    $pdfFileName = 'myFile.pdf';\n    $pdfFileByteStream = $fpdf-\u003eOutput($pdfFileName, 'S');\n    $pdfFileAttachment = \\Swift_Attachment::newInstance($pdfFileByteStream, $pdfFileName, 'application/pdf');\n    $mail-\u003eattach($pdfFileAttachment);\n    $mail-\u003esend();\n} catch (\\Exception $e) {\n    // handle error\n    $this-\u003eaddFlashMessage('E-Mail could not be sent because of an error: ' . $e-\u003egetMessage(), '', AbstractMessage::ERROR);\n}\n```\n\nYou should always catch exceptions in your php code. Experience has shown that editors often don't add a template (or translation) etc.\nCorresponding errors should somehow be handled!\n\n### Custom fluid templates\nSometimes you additionally want to wrap the mail templates from database with your own markup.\nTherefore we provide the option to customize the mail for your needs via fluid.\nAgain - via Typoscript - you can configure a rendering definition for every mail template.\n\n```typo3_typoscript\nmodule.tx_maillogger.settings.templateOverrides {\n    mytemplatekey {\n      title = My Template\n      templatePath = EXT:my_ext/Resources/Private/Templates/Mail.html\n      partialRootPaths = EXT:my_ext/Resources/Private/Partials/\n      layoutRootPaths = EXT:my_ext/Resources/Private/Layouts/\n    }\n    anothertemplatekey {\n      title = Another Template Key\n      templatePath = EXT:another_ext/Resources/Private/Templates/Mail.html\n      settings {\n        myParameter = myValue\n      }\n    }\n  }\n}\n```\n\n```html\n\u003c!-- Fluid example --\u003e\n\u003ch2\u003e{mailTemplate.subject}\u003c/h2\u003e\n\u003cf:format.raw\u003e{message}\u003c/f:format.raw\u003e\n\u003cp\u003eThis is my passed value: {settings.myValue}\u003c/p\u003e\n```\n\nThe Variables \"message\" and \"mailTemplate\" are automatically provided to your template.\nYou can use the actual message by simply wrapping it with a \"f:format.raw\"-viewhelper.\nYou can provide your own partial- and layout-paths for every template you add.\nAlternatively it will use the default paths provided by this extension.\n\nYou can add your own parameters to the template via \"settings\"-option.\n\n### example - Use a e-mail template in your own plugin\n\nIf a mail template can be selected dynamically by the editor, you can integrate a Flexform in the plugin, \nadding the following configuration:\n\n```xml\n\u003csettings.userMailTemplate\u003e\n    \u003cTCEforms\u003e\n        \u003clabel\u003eE-mail template\u003c/label\u003e\n        \u003cconfig\u003e\n            \u003ctype\u003eselect\u003c/type\u003e\n            \u003crenderType\u003eselectSingle\u003c/renderType\u003e\n            \u003cforeign_table\u003etx_maillogger_domain_model_mailtemplate\u003c/foreign_table\u003e\n            \u003cforeign_table_where\u003e ORDER BY tx_maillogger_domain_model_mailtemplate.title\u003c/foreign_table_where\u003e\n            \u003csize\u003e1\u003c/size\u003e\n            \u003cminitems\u003e1\u003c/minitems\u003e\n            \u003cmaxitems\u003e1\u003c/maxitems\u003e\n        \u003c/config\u003e\n    \u003c/TCEforms\u003e\n\u003c/settings.userMailTemplate\u003e\n```\n\n### DKIM signing of mails (NOT SUPPORTED IN VERSION 2.0 until now)\n\nYou can set a DKIM-signing for every mailtemplate you use for spam protection reasons.\nTherefore you have to define typoscript keys which you can select in the backend of a mail template.\n\nPlease note that you have to strip \"-----BEGIN RSA PRIVATE KEY-----\" and \"-----END RSA PRIVATE KEY-----\", as they are added from php with special chars you don't want to type via typoscript.\nSo only paste your private keychain as key.\n\nFor an example regarding using DKIM signing and adding the TXT-records to your DNS you can visit [this article](https://support.rackspace.com/how-to/create-a-dkim-txt-record/)\n\nKey: Your private key without \"-----BEGIN RSA PRIVATE KEY-----\" and \"-----END RSA PRIVATE KEY-----\"\nDomain: The domain from which you want to send your mail (e.g. info@example.com)\nSelector will most likely remain \"default\".\n\n```typo3_typoscript\nmodule.tx_maillogger.settings.dkim {\n    examplekey {\n      key = MYRSAPRIVATEKEY\n      domain = example.com\n      selector = default\n    }\n}\n```\n\n# with ♥️ from anders und sehr GmbH\n\n\u003e If something did not work 😮  \n\u003e or you appreciate this Extension 🥰 let us know.\n\n\u003e We are always looking for great people to join our team!\n\u003e https://www.andersundsehr.com/karriere/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersundsehr%2Fmail_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandersundsehr%2Fmail_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersundsehr%2Fmail_logger/lists"}