Repository navigation
Migrate Mailer from PHPMailer to Symfony Mailer (Doppar 4.x) - #298
Merged
Merged
Conversation
Member
|
tried local, everythings looks fine to me, thank you @techmahedy |
Member
Author
|
@rrr63 great, your are welcome |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate Mailer from PHPMailer to Symfony Mailer (Doppar 4.x)
Summary
Doppar 3.x sent mail through PHPMailer via a driver-per-transport architecture (
SmtpMailDriver,SendmailMailDriver,QmailMailDriver,MailMailDriver). This PR replaces that with Symfony Mailer for 4.x, keeps the existingMailableauthoring style (subject()/content()/attachment()) completely unchanged.doppar/frameworkMailable.php— rebuilt as a documented, readable base class (previously a bare DTO with all email-building logic bolted on as cramped one-liners). Public API:to,from,cc,bcc,attachments,subject,body(unchanged, still duck-typed againstsubject()/content()/attachment()on subclasses)html(),text(),replyTo(),header(),tag(),metadata(),priority(),attach(),embed()toEmail()builds aSymfony\Component\Mime\Emailfrom all of the above;build(Email $email)is a subclass override hook for anything the helpers don't coverAddressconstruction no longer throws on a null recipient nameMailService.php— orchestrates sending via Symfony Mailer:to(),cc(),bcc()— recipient bookkeeping (unchanged signatures)send()/deliver()(alias) — builds theEmail, applies DKIM/S-MIME signing if configured, resolves a transport, and sends viaEnvelope::create($email)Envelope::create().driver(TransportInterface|string $transport)— new escape hatch to send through a one-off Symfony transport or raw DSN, replacing the oldMailDriverInterfacepattern with Symfony's own contractresolveDsn()— assembles a DSN frommail.php's smtp parts (host/port/username/password/encryption/local_domain) when no explicitdsnis set, or passes through a literal DSN (includingfailover(...)/roundrobin(...)compound DSNs) when one istimeoutapplied post-construction viaSmtpTransport::getStream()->setTimeout()(Symfony has no DSN key for it)applySigning()— wraps the built message inDkimSigner/SMimeSignerwhen enabled in config, signers lazily built and cached per-instanceRemoved:
MailDriverInterfaceand its four PHPMailer-backed drivers (Smtp/Sendmail/Qmail/MailMailDriver) — Symfony's DSN-drivenTransport::fromDsn()already covers what these existed for; thedriver()method above is the direct replacement extension point.Facades/Mail.php—@methoddocblock updated to match the realMailServicesurface (to,cc,bcc,driver,send,deliver) with correct types; was previously missingdriver()/deliver()and had a wrongto()signature.composer.json—phpmailer/phpmailerremoved,symfony/mailer: ^8.1added.