-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer][Postmark][Transport] Support Attachment CID #59819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Up for sending a PR? |
Ordinarily I'd be happy to help but I'm under quite a large workload at the moment so I can't devote any time to properly debug and test a fix - sorry! I'm working around it in our project by using the SMTP transport instead. |
I had a few spare minutes over lunch. This apepars to work, but I've not extensively tested it. Hopefully this can help someone with a fix // Transport\PostmarkApiTransport.php:L168
if ('inline' === $disposition) {
if ($attachment -> hasContentId()) {
$att['ContentID'] = 'cid:'.$attachment->getContentId();
} else {
$att['ContentID'] = 'cid:'.$filename;
}
} |
fabpot
added a commit
that referenced
this issue
Feb 26, 2025
…(IssamRaouf) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Mailer][Postmark] Set CID for attachments when it exists | Q | A | ------------- | --- | Branch? | 6.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | Fix #59819 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- 83b0491 [Mailer][Postmark] Set CID for attachments when it exists
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
7.2
Description
Hello,
Symfony Mailer DataPart has supported
setContentId()
since #46962I don't believe the Postmark mailer bridge is correctly supporting this. The
cid:
header is hard-coded to the attachment filename.https://github.com/symfony/postmark-mailer/blob/3a43a9dee2f474ebf7c0328d3cd55d8c17b5df6f/Transport/PostmarkApiTransport.php#L169
Sorry I don't often report issues on Github so please let me know if there's any more information I can provide that would help.
How to reproduce
MAILER_DSN=postmark://ID@default
Possible Solution
Suggest
->getContentId()
however I don't have a huge amount of experience with Symfony Mailer's code so there may be a better solutionAdditional Context
Postmark API payload
Expected API payload
The text was updated successfully, but these errors were encountered: