Skip to content
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

Modify child content type in hook_data #2980

Open
michaeltalyansky opened this issue Oct 6, 2021 · 0 comments
Open

Modify child content type in hook_data #2980

michaeltalyansky opened this issue Oct 6, 2021 · 0 comments
Labels

Comments

@michaeltalyansky
Copy link

I am trying to convert text-only emails to HTML. These emails are Content-Type: multipart/mixed, and text comes as Content-Type: text/plain in the child. I would like to be able to change to Content-Type: text/html, and modify body with add_body_filter.

As far as I can see, hook_data provides me with ability to see the content type in the child, but not change it. In the hook_data_post it is too late.

Describe the solution you'd like
Would it be possible to provide in hook_data a callback with parameters like function (ct, enc, buff, headers) (where headers are the ones from the child, not from the email headers, which is transaction.body.header.get gives), so I can manipulate the headers I need and have them propagated to the child correctly?

Describe alternatives you've considered
So far, I am at a loss about how to do this.

Additional context
Email such as:

-> X-Mailer: swaks v20201014.0 jetmore.org/john/code/swaks/
-> MIME-Version: 1.0
-> Content-Type: multipart/mixed; boundary="----=_MIME_BOUNDARY_000_8111"
->
-> ------=_MIME_BOUNDARY_000_8111
-> Content-Type: text/plain
->
-> aaa
->
-> ------=_MIME_BOUNDARY_000_8111--
->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants