TYPO3 Helpers 

Extension key

ok_typo3_helper

Package name

oliverkroener/ok-typo3-helper

Version

2.0

Language

en

Author

Oliver Kroener <ok@oliver-kroener.de>

License

This document is published under the Open Publication License.

Rendered

Thu, 16 Jul 2026 07:16:10 +0000


Reusable helper traits and utilities for TYPO3, including a Microsoft Graph mail conversion service that turns a Symfony SentMessage into a Graph-ready message object — with full support for recipients, HTML/plain bodies, file attachments and inline cid: images.

Introduction 

Learn what this extension does, its features, and system requirements.

Installation 

Install the extension via Composer and activate it in your TYPO3 project.

Usage 

Convert messages for Microsoft Graph and use the reflection trait.

Contact 

Get in touch with the author for support, questions, or contributions.

Introduction 

The TYPO3 Helpers extension (ok_typo3_helper) provides a small set of reusable helper traits and utilities for TYPO3 projects. Its centrepiece is a Microsoft Graph mail conversion service that bridges TYPO3's Symfony-based mailer with the Microsoft Graph API.

What it does 

Microsoft Graph mail conversion 

The OliverKroenerHelpersMSGraphApiMSGraphMailApiService service parses a raw Symfony SentMessage (MIME) and produces a MicrosoftGraphModelMessage object that is ready to be sent through the Microsoft Graph sendMail endpoint. It covers:

  • Recipients — maps From, To, CC, BCC and Reply-To addresses, including display names.
  • Body — supports both HTML and plain-text content, with a graceful fallback when neither is present.
  • Attachments — converts every file attachment into a Graph FileAttachment with base64-encoded content bytes.
  • Inline images (cid:) — inline parts are detected from their Content-Disposition: inline header, flagged with isInline and given their original Content-ID, so cid: references in the HTML body render correctly in the delivered mail.

Reflection properties trait 

The OliverKroenerHelpersTraitsReflectionPropertiesTrait trait adds dynamic getX() / setX() magic accessors to any class, resolving the underlying property through reflection.

Requirements 

  • TYPO3: 10.4 LTS
  • PHP: 7.2 or higher
  • Dependencies: microsoft/microsoft-graph ^1 and zbateson/mail-mime-parser ^2

Installation 

The extension is installed with Composer.

Composer 

composer require oliverkroener/ok-typo3-helper
Copied!

Local path repository 

For local development, expose the extension through a path repository in your project's root composer.json:

{
    "repositories": [
        {
            "type": "path",
            "url": "packages/*"
        }
    ]
}
Copied!

Then require and activate it:

composer require oliverkroener/ok-typo3-helper:@dev
vendor/bin/typo3 extension:activate ok_typo3_helper
Copied!

Dependencies 

Composer resolves the runtime dependencies automatically:

Usage 

Convert a message for Microsoft Graph 

Pass a Symfony SentMessage to MSGraphMailApiService::convertToGraphMessage(). It returns an array with the Graph message object and the resolved sender address:

use OliverKroener\Helpers\MSGraphApi\MSGraphMailApiService;
use Symfony\Component\Mailer\SentMessage;

/** @var SentMessage $sentMessage */
$result = MSGraphMailApiService::convertToGraphMessage($sentMessage);

$graphMessage = $result['message']; // Microsoft\Graph\Model\Message
$fromAddress  = $result['from'];    // string, the sender address

// $graphMessage can now be passed to the Microsoft Graph "sendMail" request.
Copied!

Inline images referenced in the HTML body via cid: are detected automatically from their Content-Disposition: inline header and carried over with their Content-ID, so embedded graphics render in the delivered mail.

Dynamic property accessors 

Use ReflectionPropertiesTrait to add magic getters and setters to any class. The trait resolves the property through reflection:

use OliverKroener\Helpers\Traits\ReflectionPropertiesTrait;

class Contact
{
    use ReflectionPropertiesTrait;

    private string $email = '';
}

$contact = new Contact();
$contact->setEmail('ok@oliver-kroener.de'); // magic setter
echo $contact->getEmail();                   // magic getter
Copied!

Calling an accessor for a property that does not exist throws an Exception.

Development tooling 

The extension ships with static analysis and coding-standards tooling, exposed as Composer scripts:

composer run stan       # PHPStan (level 5, TYPO3 stubs)
composer run cs:check   # PHP-CS-Fixer dry-run (TYPO3 coding standards)
composer run cs:fix     # PHP-CS-Fixer apply
Copied!

Contact 

Author — Oliver Kroener 

Automated. Scaled. Done. 

Web3 · Cloud · Automation

Technology is only valuable when it solves a real problem. For over 30 years I've been translating between business and tech — so your investment in digitalisation doesn't stall at proof-of-concept but delivers measurable results.

Support 

If you encounter issues or have questions about this extension:

Contributing 

Contributions are welcome. Please open a pull request or issue on GitHub.

License 

This extension is licensed under the GPL-2.0-or-later.