Skip to content

[6.x] Mailer#18519

Open
riasvdv wants to merge 13 commits into6.xfrom
feature/mail
Open

[6.x] Mailer#18519
riasvdv wants to merge 13 commits into6.xfrom
feature/mail

Conversation

@riasvdv
Copy link
Contributor

@riasvdv riasvdv commented Mar 5, 2026

Removes the email settings as all mail settings should be configured through Laravel. This PR adds a replacement admin-only utility to view the mail settings and send a test email to preserve that functionality

image

@riasvdv riasvdv changed the base branch from 5.x to 6.x March 5, 2026 14:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates Craft 6.x mail functionality away from legacy Yii transport adapters and the Craft notification channel, aligning outbound email with Laravel’s mail configuration/drivers and introducing a new “Email Settings” utility for visibility + test sends.

Changes:

  • Replace legacy mail transport adapter configuration/UI with Laravel mail driver configuration; remove legacy email settings routes/pages and project config seed.
  • Introduce SystemMessageMailable (Laravel Mailable) for rendering/sending system messages, and update user notifications to use Laravel’s MailChannel.
  • Add a new CP Utility + controller and a new console command to send test emails, with accompanying tests.

Reviewed changes

Copilot reviewed 59 out of 63 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
yii2-adapter/tests/unit/mail/MailerTest.php Updates legacy mailer tests to assert new system-message rendering output.
yii2-adapter/tests/unit/helpers/MailerHelperTest.php Adds coverage for deprecating/ignoring custom transport registrations.
yii2-adapter/tests/unit/helpers/AppHelperTest.php Updates expected mailer config to come from Laravel mail config/runtime transport.
yii2-adapter/legacy/services/SystemMessages.php Updates docs to point to SystemMessages + Laravel Mail usage, while keeping legacy API note.
yii2-adapter/legacy/mail/transportadapters/Smtp.php Deprecates legacy adapter UI and returns a “ignored” notice.
yii2-adapter/legacy/mail/transportadapters/Sendmail.php Deprecates legacy adapter UI and returns a “ignored” notice.
yii2-adapter/legacy/mail/transportadapters/Gmail.php Deprecates legacy adapter UI and returns a “ignored” notice.
yii2-adapter/legacy/mail/Mailer.php Routes legacy composeFromKey sending through SystemMessageMailable + Laravel transport.
yii2-adapter/legacy/helpers/MailerHelper.php Stops honoring custom transport registration; reports Laravel mailer settings instead.
yii2-adapter/legacy/helpers/App.php Builds legacy mailer component config from Laravel mail config + Symfony transport.
yii2-adapter/legacy/controllers/SystemSettingsController.php Removes legacy email settings CP actions (edit/save/test).
yii2-adapter/legacy/console/controllers/MailerController.php Removes legacy CLI mailer test controller.
yii2-adapter/legacy/config/cproutes/common.php Removes CP route for /settings/email.
yii2-adapter/legacy/base/ApplicationTrait.php Marks getMailer() as deprecated in favor of Laravel mailers/system-message mailables.
tests/Feature/User/PasswordResetTest.php Asserts notifications use Laravel MailChannel rather than a custom channel.
tests/Feature/User/EmailVerificationTest.php Asserts notifications use Laravel MailChannel rather than a custom channel.
tests/Feature/SystemMessage/SystemMessageMailableTest.php Adds feature tests for subject/text/html rendering + locale behavior.
tests/Feature/Integration/PagesTest.php Moves “Email Settings” expectation from Settings page to new utility route.
tests/Feature/Http/Controllers/Utilities/MailSettingsControllerTest.php Adds tests for utility action authorization, validation, and success flash.
tests/Feature/Console/Commands/Mailer/TestCommandTest.php Adds tests for new craft:mailer:test command behavior.
src/Utility/Utilities/MailSettings.php New utility to display mail config/settings and provide default “to” address.
src/Utility/Utilities.php Registers the new Mail Settings utility and switches volumes check to Volumes facade.
src/User/Notifications/VerifyEmailNotification.php Migrates to MailChannel and returns a SystemMessageMailable from toMail().
src/User/Notifications/ResetPasswordNotification.php Migrates to MailChannel and returns a SystemMessageMailable from toMail().
src/SystemMessage/SystemMessages.php Adds mailable() factory for system-message-based Laravel mailables.
src/SystemMessage/Mailables/SystemMessageMailable.php New Mailable that renders system messages with Twig sandbox + markdown conversion.
src/SystemMessage/Events/RegisterSystemMessages.php Updates docs to demonstrate new system-message mailable send pattern.
src/SystemMessage/Data/RenderedSystemMessage.php Adds DTO for rendered system-message output.
src/SystemMessage/Actions/SendTestMailAction.php Adds action to send the test_email system message with a settings report.
src/Notifications/Channels/CraftChannel.php Removes custom notification channel in favor of Laravel’s mail channel.
src/Http/Controllers/Utilities/MailSettingsController.php Adds utility action endpoint to validate recipient + send test email with flash response.
src/Database/Migrations/Install.php Stops writing legacy email project config during install.
src/Database/Migrations/0000_00_00_000010_remove_legacy_email_project_config.php Adds migration to remove legacy email project config key.
src/Cp/Settings.php Removes “Email” from CP Settings navigation.
src/Console/ConsoleServiceProvider.php Registers the new mailer test console command.
src/Console/Commands/SendTestMailCommand.php Adds craft:mailer:test command with interactive prompt + settings table output.
routes/actions.php Adds new action route for utilities mail test send endpoint.
resources/views/mail/system-message.blade.php Adds markdown wrapper view for system message HTML.
resources/views/mail/system-message-text.blade.php Adds plain-text view for system message text.
resources/templates/settings/email/_index.twig Removes legacy CP Email Settings template.
resources/templates/_components/mailertransportadapters/Smtp/settings.twig Removes legacy SMTP adapter settings UI template.
resources/templates/_components/mailertransportadapters/Sendmail/settings.twig Removes legacy Sendmail adapter settings UI template.
resources/templates/_components/mailertransportadapters/Gmail/settings.twig Removes legacy Gmail adapter settings UI template.
resources/js/components/utilities/MailSettings/MailSettings.vue Adds Vue utility UI to view settings and submit a test email request.
resources/js/bootstrap/cp.ts Registers the new MailSettings utility component with the CP app.
resources/build/legacy.js Updates compiled legacy bundle output from build.
resources/build/Updater.js Updates compiled updater bundle output from build.
resources/build/SettingsSitesIndex.js Updates compiled settings sites bundle output from build.
resources/build/SettingsSectionsIndexPage.js Updates compiled sections settings bundle output from build.
resources/build/SettingsIndexPage.js Updates compiled settings index bundle output from build.
resources/build/SettingsGeneralPage.js Updates compiled general settings bundle output from build.
resources/build/Install.js Updates compiled installer bundle output from build.
resources/build/IndexLayout.js Updates compiled index layout bundle output from build.
resources/build/DeleteSiteModal.vue_vue_type_script_setup_true_lang.js Updates compiled delete-site modal bundle output from build.
resources/build/CpQueueIndicator.js Updates compiled queue indicator bundle output from build.
resources/build/CalloutReadOnly.vue_vue_type_script_setup_true_lang.js Updates compiled read-only callout bundle output from build.
resources/build/AppLayout.js Updates compiled app layout bundle output from build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@riasvdv riasvdv marked this pull request as ready for review March 7, 2026 19:23
@riasvdv riasvdv requested a review from brandonkelly March 7, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants