mail-builder icon indicating copy to clipboard operation
mail-builder copied to clipboard

Build email from parsed email

Open mdsimmo opened this issue 1 year ago • 3 comments

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.

mdsimmo avatar Apr 21 '23 10:04 mdsimmo

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?

soywod avatar May 31 '23 12:05 soywod

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.

mdecimus avatar Jun 03 '23 07:06 mdecimus

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.

soywod avatar Jun 04 '23 14:06 soywod