stalwartlabs / mail-builder

E-mail builder library for Rust
https://docs.rs/mail-builder/
Apache License 2.0
53 stars 16 forks source link

Build email from parsed email #10

Open mdsimmo opened 1 year ago

mdsimmo commented 1 year ago

Is there a convenient way to use this crate in conjunction with your other crate (mail-parser) to

  1. read in an email,
  2. convert the Message to a MessageBuilder,
  3. make some modifications to the email
  4. then send it (using mail-send or, in my case, a third party library)

Current best solution I have is to copy over field by field. I'm hoping there's a built in way.... '

The use case for this is I'm building a marketing engine. The user sends an email to my app, the app reads the email and adds unsubscribe links, edits content data, etc.

soywod commented 1 year ago

I had a similar need, I ended up building it from scratch by iterating over headers and body parts. I could adapt my code and propose a PR, @mdecimus would you be interested in?

mdecimus commented 1 year ago

Sure @soywod , a PR would be nice. This functionality should be an optional feature so the mail-parser dependency is only included when this feature is needed.

soywod commented 1 year ago

Sure @soywod , a PR would be nice. This functionality should be an optional feature so the mail-parser dependency is only included when this feature is needed.

In fact I needed a simpler version of this conversion, a complete one would require more work. I keep in mind if one day I have time to complete it.