PHPackages                             oliverkroener/ok-typo3-helper - 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. oliverkroener/ok-typo3-helper

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

oliverkroener/ok-typo3-helper
=============================

A TYPO3 extension with helper traits and utilities.

3.1.2(1mo ago)019.0k↓23.5%1GPL-2.0-or-laterPHP

Since Sep 20Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/oliverkroener/ok_typo3_helper)[ Packagist](https://packagist.org/packages/oliverkroener/ok-typo3-helper)[ Docs](https://www.oliver-kroener.de)[ RSS](/packages/oliverkroener-ok-typo3-helper/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (6)Versions (20)Used By (1)

TYPO3 Helpers (`ok_typo3_helper`)
=================================

[](#typo3-helpers-ok_typo3_helper)

[![TYPO3 12](https://camo.githubusercontent.com/2684d7b10857a7fbe915ab7d09d7f77e12dd4ad82d59d74d33de17e09c6939a6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5459504f332d31322d6f72616e67653f6c6f676f3d7479706f33)](https://get.typo3.org/version/12)[![TYPO3 13](https://camo.githubusercontent.com/dd8defc1bd50d5ea9806215644f9b57c5c16a94a7dd0fc400d4b9ff87e3a7874/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5459504f332d31332d6f72616e67653f6c6f676f3d7479706f33)](https://get.typo3.org/version/13)[![TYPO3 14](https://camo.githubusercontent.com/e529124be6a5d4fa54f1e7947268a827ebb324837ad7d64b2eaf2dea68a14b83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5459504f332d31342d6f72616e67653f6c6f676f3d7479706f33)](https://get.typo3.org/version/14)[![PHP 8.1+](https://camo.githubusercontent.com/3e41095f4ad1c6ad78f988bd1c107f87972f334143c3ba814165a03e1f43a63c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/)[![License: GPL v2+](https://camo.githubusercontent.com/6453309dcfa061355d200754f7c0067d22bebd9d9c754ce6b9216176e797e8ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c25323076322532422d626c7565)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)[![Version](https://camo.githubusercontent.com/5f30fe200be7ab750620ca2c42481e442c9b7e681ee0095c1b1f4f070d853e1d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d332e312e322d677265656e)](https://github.com/oliverkroener/ok_typo3_helper)

Reusable helper traits, services, and a Microsoft Graph mail converter that other Oliver Kröner TYPO3 extensions build on.

---

Features
--------

[](#features)

- **Microsoft Graph mail converter** (`MSGraphMailApiService`) — converts a Symfony `SentMessage` into a Microsoft Graph `Message` object ready for the Graph `sendMail` endpoint. It maps From/To/Cc/Bcc/Reply-To recipients, HTML and plain-text bodies, and file attachments. This is the conversion layer used by [`ok_exchange365_mailer`](https://github.com/oliverkroener/ok_exchange365_mailer).
    - **Inline images (`cid:`) support** — attachments marked `Content-Disposition: inline` are flagged as inline **and** their original MIME `Content-ID` is carried onto the Graph `FileAttachment`. Without this, Graph cannot bind an `` in the HTML body to its attachment and the image renders broken. The Content-ID is read via `getContentId()`, which already returns the value without the surrounding `` so it matches the `cid:` reference in the body verbatim.
- **Site root resolver** (`SiteRootService`) — a singleton service that returns the site root page UID for any given page UID, resolving `SiteNotFoundException` to `null`.
- **Reflection accessor trait** (`ReflectionPropertiesTrait`) — adds dynamic `getXxx()` / `setXxx()` access to any class's properties (including protected/private) via `__call()` and reflection.

---

Requirements
------------

[](#requirements)

- TYPO3 12.4 LTS, 13.4 LTS, or 14 LTS
- PHP 8.1 or newer
- [`microsoft/microsoft-graph`](https://packagist.org/packages/microsoft/microsoft-graph) `^2` (pulled in automatically)
- [`zbateson/mail-mime-parser`](https://packagist.org/packages/zbateson/mail-mime-parser) `^3` (pulled in automatically)

---

Installation
------------

[](#installation)

Install via Composer:

```
composer require oliverkroener/ok-typo3-helper
```

As a local path-repository extension (as used in this project), add the package under `packages/` and require it as a dev version:

```
composer require oliverkroener/ok-typo3-helper:@dev
```

Then set it up:

```
vendor/bin/typo3 extension:setup
vendor/bin/typo3 cache:flush
```

---

Usage
-----

[](#usage)

### Converting a message for Microsoft Graph

[](#converting-a-message-for-microsoft-graph)

`MSGraphMailApiService::convertToGraphMessage()` is `static` and takes a Symfony `SentMessage`, returning an array with the built Graph `message` and the resolved `from` address:

```
use OliverKroener\Helpers\MSGraphApi\MSGraphMailApiService;

$result = MSGraphMailApiService::convertToGraphMessage($sentMessage);
$graphMessage = $result['message']; // Microsoft\Graph\Generated\Models\Message
$fromAddress  = $result['from'];    // string|null
```

Inline images work automatically: build the mail with Symfony's `->embed()` (or a TYPO3 Fluid mail template with an inline image), and the resulting `cid:` reference in the HTML body is preserved end-to-end into the Graph attachment's `contentId`.

### Resolving the site root

[](#resolving-the-site-root)

```
use OliverKroener\Helpers\Service\SiteRootService;

// Injected via DI (registered public in Configuration/Services.yaml)
$rootPageId = $siteRootService->findNextSiteRoot($currentPageId); // int|null
```

### Dynamic property accessors

[](#dynamic-property-accessors)

```
use OliverKroener\Helpers\Traits\ReflectionPropertiesTrait;

class MyModel
{
    use ReflectionPropertiesTrait;

    private string $title = '';
}

$model = new MyModel();
$model->setTitle('Hello');   // routed through __call → reflection
echo $model->getTitle();     // "Hello"
```

---

Architecture
------------

[](#architecture)

ComponentClassRoleGraph mail converter`OliverKroener\Helpers\MSGraphApi\MSGraphMailApiService`Parses a MIME `SentMessage` and rebuilds it as a Graph `Message`Site root resolver`OliverKroener\Helpers\Service\SiteRootService`Maps a page UID to its site root page UID (singleton, DI-registered)Reflection trait`OliverKroener\Helpers\Traits\ReflectionPropertiesTrait`Dynamic getters/setters via `__call()` + reflection```
ok_typo3_helper/
├── Classes/
│   ├── MSGraphApi/
│   │   └── MSGraphMailApiService.php
│   ├── Service/
│   │   └── SiteRootService.php
│   └── Traits/
│       └── ReflectionPropertiesTrait.php
├── Configuration/
│   └── Services.yaml
├── Resources/
│   └── Public/Icons/Extension.png
├── ext_emconf.php
├── ext_localconf.php
└── composer.json

```

---

License
-------

[](#license)

This extension is licensed under the [GPL-2.0-or-later](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). See the [LICENSE](LICENSE) file for the full text.

---

Author — Oliver Kroener
-----------------------

[](#author--oliver-kroener)

### Automated. Scaled. Done.

[](#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.

- Website: [oliver-kroener.de](https://www.oliver-kroener.de)
- Web3: [web3.oliver-kroener.de](https://web3.oliver-kroener.de/)
- Email:
- Web3 Email:

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance93

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~44 days

Total

16

Last Release

34d ago

Major Versions

1.0.0 → 2.0.02024-09-20

2.0.0 → 3.0.02024-09-20

2.0.1 → 3.0.62025-07-29

1.0.1 → 3.1.02026-01-21

2.0.2 → 3.1.22026-07-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e3131f46d9c0fc7766936f374848d0ab6be6f8095f2f2c01984736a5e7fcd52?d=identicon)[Oliver Kroener](/maintainers/Oliver%20Kroener)

---

Top Contributors

[![oliverkroener](https://avatars.githubusercontent.com/u/4545439?v=4)](https://github.com/oliverkroener "oliverkroener (43 commits)")

---

Tags

helpermimeemailmailerutilitiestypo3typo3-extensionMicrosoft graphexchange365inline-attachmentssite-root

### Embed Badge

![Health badge](/badges/oliverkroener-ok-typo3-helper/health.svg)

```
[![Health](https://phpackages.com/badges/oliverkroener-ok-typo3-helper/health.svg)](https://phpackages.com/packages/oliverkroener-ok-typo3-helper)
```

###  Alternatives

[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

40543.5k](/packages/wazum-sluggi)[mediaessenz/mail

Powerful newsletter system for TYPO3

1112.2k3](/packages/mediaessenz-mail)[maize-tech/laravel-msgraph-mailer

Laravel mail transport driver for sending emails via Microsoft Graph API with OAuth2 authentication

101.3k](/packages/maize-tech-laravel-msgraph-mailer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
