From 2c67606bdb6b3979555a812aa0fbdce1afba4ebd Mon Sep 17 00:00:00 2001 From: Ghassan Yusuf Date: Tue, 26 May 2026 11:18:06 +0300 Subject: [PATCH] feat: integrate promoseven/azure-mailer as mail transport Adds path repository, composer dependency, azure mailer config entry, and AZURE_* env vars to .env.example. Co-Authored-By: Claude Sonnet 4.6 --- .env.example | 6 ++++++ composer.json | 5 +++++ composer.lock | 55 +++++++++++++++++++++++++++++++++++++++++++++++-- config/mail.php | 8 +++++++ 4 files changed, 72 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 0931a45..2d22504 100644 --- a/.env.example +++ b/.env.example @@ -69,3 +69,9 @@ ULTRAMSG_TOKEN= ULTRAMSG_WEBHOOK_SECRET= ULTRAMSG_WEBHOOK_PATH=ultra-message/webhook ULTRAMSG_ENABLED=true + +# Microsoft 365 / Azure AD Mail +AZURE_TENANT_ID= +AZURE_CLIENT_ID= +AZURE_CLIENT_SECRET= +AZURE_MAIL_FROM_ADDRESS= diff --git a/composer.json b/composer.json index af015f5..93f9b5c 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,10 @@ { "type": "path", "url": "../ultra-message" + }, + { + "type": "path", + "url": "../azure-mailer" } ], "require": { @@ -17,6 +21,7 @@ "laravel/framework": "^12.0", "laravel/tinker": "^2.10.1", "phpoffice/phpspreadsheet": "^5.7", + "promoseven/azure-mailer": "*", "promoseven/ultra-message": "*", "spatie/laravel-permission": "^6.25" }, diff --git a/composer.lock b/composer.lock index 1f4292e..f62fe7b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2e7e9aaaedaec1e83a6d6b3e82228dda", + "content-hash": "5daed94f08a2aff0bba86affd37a0cd6", "packages": [ { "name": "barryvdh/laravel-dompdf", @@ -3278,13 +3278,64 @@ ], "time": "2025-12-27T19:41:33+00:00" }, + { + "name": "promoseven/azure-mailer", + "version": "dev-master", + "dist": { + "type": "path", + "url": "../azure-mailer", + "reference": "d240f4f64afcd094b30cd460b82f809f3b2003f9" + }, + "require": { + "illuminate/cache": "^11.0|^12.0", + "illuminate/http": "^11.0|^12.0", + "illuminate/mail": "^11.0|^12.0", + "illuminate/support": "^11.0|^12.0", + "php": "^8.2", + "symfony/mailer": "^7.0" + }, + "require-dev": { + "orchestra/testbench": "^10.0", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "PromoSeven\\AzureMailer\\AzureMailerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "PromoSeven\\AzureMailer\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "PromoSeven\\AzureMailer\\Tests\\": "tests/" + } + }, + "scripts": { + "test": [ + "vendor/bin/phpunit" + ] + }, + "license": [ + "MIT" + ], + "description": "Laravel mail transport for Microsoft 365 via Azure AD Graph API", + "transport-options": { + "relative": true + } + }, { "name": "promoseven/ultra-message", "version": "dev-master", "dist": { "type": "path", "url": "../ultra-message", - "reference": "36323902378c10fffd7c2f795360f06072b2fd51" + "reference": "56160235808f7d9d9dd3ec8d0eefa20a17807647" }, "require": { "illuminate/http": "^11.0|^12.0", diff --git a/config/mail.php b/config/mail.php index e32e88d..5e21540 100644 --- a/config/mail.php +++ b/config/mail.php @@ -49,6 +49,14 @@ return [ 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)), ], + 'azure' => [ + 'transport' => 'azure', + 'tenant_id' => env('AZURE_TENANT_ID'), + 'client_id' => env('AZURE_CLIENT_ID'), + 'client_secret' => env('AZURE_CLIENT_SECRET'), + 'from_address' => env('AZURE_MAIL_FROM_ADDRESS'), + ], + 'ses' => [ 'transport' => 'ses', ],