KNHaw / ThunderbirdObsidianClipper

A Thunderbird extension to clip messages to the Obsidian notetaking application.
Mozilla Public License 2.0
16 stars 0 forks source link

Feature Request: Use Thunderbirds "save as " feature as addition to creating a note. #5

Open DaDirnbocher opened 10 months ago

DaDirnbocher commented 10 months ago

For some reasons I would like to have not only a note for an email but also a saved *.eml file. (e.g. if i also have also the eml file, the limitations mentioned - no html content, no attachments - would be solved for me).

So my preferred workflow would be like that:

This would require to do the filename corrections also in the body of the note (in my ![[_MSGSUBJECT.eml]]) - or you create a new placeholder like _FILENAME which could be used in the template then.

KNHaw commented 10 months ago

Hmmm. The filename part is doable but I'm going to have to research how to generate and save EML files programmatically within Thunderbird. I'm concerned that Thunderbird would have to write the file instead of Obsidian (as the add-on is currently doing). That would mean the user would also have to specify the actual location on the drive tree of where they'd want the end file, which would cause problems if the user physically ever moves the vault. Also there might be file protection/permission issues since we would have two different apps writing to the same directories.

I will say this is an interesting alternative to my original roadmap of first adding attachment support and then doing some funky HTML/MD5 conversion. I was looking at readablilty.js for the latter but have a nagging feeling that might generate more issues than it resolves. Your idea gets around all that.

No promises. I'm honestly not sure if I will be able to figure this out. And if we go this route its at least a few weeks or more out in the future. But I will look at it and see what I can do. I'll try to get back to you in a few days and let you know what I found. Regardless, though, thank you for the honest feedback. I honestly do appreciate it.

DaDirnbocher commented 10 months ago

Hmmm. The filename part is doable but I'm going to have to research how to generate and save EML files programmatically within Thunderbird.

My suggestion is to use (if possible) thunderbirds functionality not to reimplement the "save as eml".

assume you can simulate from within your plugin the "save as" action a user would do, and you can specify the location/filename (as a user would do in the upcoming dialog) - so no further settings for location/filename would be necessary.

Just to be sure: for some reasons i always need a note and a eml - if i could do both with one action i would be a simplification of my workflow.

Maybe https://addons.thunderbird.net/en-US/thunderbird/addon/importexporttools/ is helpful for you.

Or: https://github.com/pgpgeek/thunderbird-addon-eml-editor/blob/main/scripts/others/save_eml.js (disclaimer: didnt check the licencse)