AddOn


Symfony Mailer für REDAXO

Beschreibung

Symfony Mailer für REDAXO

Symfony Mailer für REDAXO


github.com/FriendsOfREDAXO/symfony_mailer

Umsetzung

Versionen

1.0.0-beta3

Für REDAXO
^5.18.1
Veröffentlicht am
09.02.2025
Require / PHP
>=8.2

Neu:
Für @alxndr-w

EP um die Config zu überschreiben

// In einer boot.php oder einem anderen geeigneten Ort

rex_extension::register('SYMFONY_MAILER_CONFIG', function(rex_extension_point $ep) {
    $config = $ep->getSubject(); // Leeres Array zu Beginn

    // Basis-Konfiguration
    $config['from'] = 'noreply@meinedomain.de';
    $config['name'] = 'Mein Projekt';
    $config['charset'] = 'utf-8';

    // SMTP-Einstellungen
    $config['host'] = 'smtp.meinedomain.de';
    $config['port'] = 587;
    $config['security'] = 'tls';
    $config['auth'] = true;
    $config['username'] = 'smtp_user';
    $config['password'] = 'smtp_password';

    // Debug und Archivierung
    $config['debug'] = false;
    $config['archive'] = true;

    // Beispiel: Andere Einstellungen für Entwicklungsumgebung
    if (rex::isDebugMode()) {
        $config['debug'] = true;
        $config['from'] = 'dev-' . $config['from'];
        $config['detour_mode'] = true;
        $config['detour_address'] = 'entwickler@meinedomain.de';
    }

    // Beispiel: Unterschiedliche SMTP-Server je nach Domain
    $domain = $_SERVER['HTTP_HOST'] ?? '';
    switch ($domain) {
        case 'projekt1.de':
            $config['host'] = 'smtp.projekt1.de';
            $config['username'] = 'smtp@projekt1.de';
            $config['password'] = 'projekt1_smtp_pw';
            break;

        case 'projekt2.de':
            $config['host'] = 'smtp.projekt2.de';
            $config['username'] = 'smtp@projekt2.de';
            $config['password'] = 'projekt2_smtp_pw';
            break;
    }

    return $config;
});

1.0.0-beta2

Für REDAXO
^5.18.1
Veröffentlicht am
25.01.2025
Require / PHP
>=8.2

Small fixes

1.0.0-beta1

Für REDAXO
^5.18.1
Veröffentlicht am
23.01.2025
Require / PHP
>=8.2

😀 Huhu! ... hier die erste Beta.
Bitte testen.

What's Changed

New Contributors

Full Changelog: https://github.com/FriendsOfREDAXO/symfony_mailer/commits/1.0.0-beta1