Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow Usage of ContentId in html #17703

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

Closed
fabpot opened this issue Jan 10, 2023 · 6 comments
Closed

Allow Usage of ContentId in html #17703

fabpot opened this issue Jan 10, 2023 · 6 comments
Labels
hasPR A Pull Request has already been submitted for this issue. Mime Waiting feedback
Milestone

Comments

@fabpot
Copy link
Member

fabpot commented Jan 10, 2023

Q A
Feature PR symfony/symfony#48901
PR author(s) @m42e
Merged in 6.3

We created this issue to not forget to document this new feature. We would really appreciate if you can help us with this task. If you are not sure how to do it, please ask us and we will help you.

To fix this issue, please create a PR against the 6.3 branch in the symfony-docs repository.

Thank you! 😄

@fabpot fabpot added this to the 6.3 milestone Jan 10, 2023
@xabbuh xabbuh added the Mime label Feb 3, 2023
@javiereguiluz
Copy link
Member

Looking at the code PR (symfony/symfony#48901), I don't fully understand the description or the code/tests.

@m42e could you please show some scenario where this feature would be useful and a short example of how to use it? Thanks!

@m42e
Copy link

m42e commented May 22, 2023

@javiereguiluz
The major use-case is anonaddy when forwarding a mail that already has the ids in the text. The workaround would be to replace the ids with a name, which is afterwards replaced by an id again.

@javiereguiluz
Copy link
Member

Thanks. Can you share a real example of using this feature? Of course, if you prefer, you can submit a PR yourself.

@m42e
Copy link

m42e commented May 22, 2023

Here is an example, stolen from https://github.com/anonaddy/anonaddy/blob/4f47bc4f4cf15e20555e99290e09cc85e82691ba/app/Mail/ForwardEmail.php#L232

foreach ($this->emailInlineAttachments as $attachment) {
                        $part = new InlineImagePart(base64_decode($attachment['stream']), base64_decode($attachment['file_name']), base64_decode($attachment['mime']));

                        $part->asInline();

                        $part->setContentId(base64_decode($attachment['contentId']));
                        $part->setFileName(base64_decode($attachment['file_name']));

                        $message->attachPart($part);
                    }

It is using the content_id as part identification and it does not touch the body of the mail message. The original message content will still reference the content_id

@m42e
Copy link

m42e commented May 22, 2023

Does this help? I don|t know how to better describe it.

@alamirault
Copy link
Contributor

@m42e I tried to document this PR behavior in #18817

I think we shouldn't document you're use case but be more generic.

Review is welcomed 😄

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. Mime Waiting feedback
Projects
None yet
Development

No branches or pull requests

5 participants