Skip to content

Added ability to extract text and html from multipart messages#157

Merged
roelvanduijnhoven merged 4 commits intoWebador:masterfrom
kynx:extract-from-multipart-messages
Nov 17, 2023
Merged

Added ability to extract text and html from multipart messages#157
roelvanduijnhoven merged 4 commits intoWebador:masterfrom
kynx:extract-from-multipart-messages

Conversation

@kynx
Copy link
Copy Markdown

@kynx kynx commented Nov 16, 2023

I'm moving an application that uses vanilla laminas-mail to this library. It composes email messages with text, html and attachment parts pretty-much exactly as described in https://docs.laminas.dev/laminas-mail/message/attachments/#multipartalternative-emails-with-attachments, with a multipart/alternative part containing the text and html, followed by one or more parts for the attachments.

Currently this library doesn't look inside the multipart/alternative part, so never finds the text and html. This PR fixes that.

Comment thread README.md

> For accessibility purposes, you should *always* provide both a text and HTML version of your mails.

### `multipart/alternative` emails with attachments
Copy link
Copy Markdown
Author

@kynx kynx Nov 17, 2023

Choose a reason for hiding this comment

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

I've raised a PR against laminas/laminas-mail to fix what I think are issues with their documentation. If that's merged this section may not be needed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@kynx It seems they are merging your work :). So .. what do you think makes most sense here? Drop this PR, or merge it neverthless?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This PR is still required so the text and html can be extracted from the multipart/alternative part. But I'll just link to the laminas docs for a (now correct) example of how to create the email in the first place.

@roelvanduijnhoven roelvanduijnhoven merged commit b40a982 into Webador:master Nov 17, 2023
@roelvanduijnhoven
Copy link
Copy Markdown
Collaborator

Thanks @kynx. I've published pre-release v4.7.0-alpha. Can you test it out, and let me know if it works? I'll do the same on my end! And I'll publish a new release in a weeks time.

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