Joplin Export: Export emails from Thunderbird to Joplin

Ok, i confirm it works without space. I use (a) to have this tag on the top of list in joplin.

:wink:

1 Like

Just for documentation: Joplin seems to strip spaces at the start and end of tags. The basic export procedure is:

  1. Search for tag " mail" -> no results, since tag " mail" is non-existent
  2. Create tag " mail" -> a tag named "mail" is created in Joplin
  3. Search again for " mail" -> no results, since tag " mail" is non-existent
  4. Create tag " mail" -> fails, because the space is stripped and a tag named "mail" is already existent

Since it isn't the users intention to create a tag with starting spaces, it can stripped in the Thunderbird addon already. So we don't trigger this problem anymore.

2 Likes

@Marph, this is an awesome addon! Thank you for your time and effort in its development.

3 Likes

Thanks, @Marph. The dropdown sounds good to me, and yes, those four header fields are just right.

Thank you for this. This is one thing I was missing moving from Todoist and Evernote where you could email into the system. Now I just run Thunderbird and Joplin on the same computer and works perfectly!

1 Like

Update for the two latest feature requests:

  • The folder selection at each export seems to be non-trivial. The "Get Messages" style button is not available for add-ons. An alternative would be an option in the context menu. However, I couldn't figure out how to get a nested context menu. So I didn't implement it for now.
  • Header information at top of the note: There is now an option to enable the info. The layout is hardcoded for now. I tried Nunjucks and really liked it. The implementation worked, but there is a warning about user defined templates. Not sure if it's a security risk in this case, but I didn't add it for this reason.

I uploaded the add-on in this state to the Thunderbird store. It's waiting for review.

2 Likes

I've been checking every few days for Joplin Export to appear in the Thunderbird store, and spotted it a few minutes ago. The mail headers look great.

Thank you!

1 Like

Fine. The review did just finish and the add-on is available at the Thunderbird store now: Joplin Export :: Add-ons für Thunderbird :tada:

6 Likes

How do I specify which Joplin notebook the email is exported to? Your READ.md doesn’t mention it.

I exported a test email and I had to search for it, have no idea why it was where I found it.

I had to I expected it be in the Web Clipper specified notebook but it wasn’t

Joplin Portable 2.7.15.
Windows 10 21H1
Thunderbird 98.8.1
Joplin Export T’bird Addon 0.0.1

@RogerL did you specify the notebook here as shown in the readme video?

Edit: The option is called "Parent folder".

Ah, no I hadn’t. May I suggest you rename it as Destination Notebook and perhaps throw an error if the field is empty?

1 Like

Both seem to be good additions from user perspective. The API uses the name "parent folder", but for the user that naming isn't very helpful. I will try to include the changes in the next release. Thanks for the feedback!

3 Likes

Also the text when you hover over the i should say “The exported notes will be stored in this notebook”

1 Like

Hi @Marph

Thanks again for this great extension!

Just a question of usage after a few weeks. I realize that many times I don't need the recipient part of the subject line because I have that information in the header table.

Do you think it would be interesting/useful to provide an option to not have this info in the title anymore? Or maybe with a great regular expression in "trim" it is possible? :thinking:

1 Like

Hi @bepolymathe,

it would be useful to have this option. In fact, I experimented previously with Nunjucks and got a PoC working. It would allow the user to define how the note title and body would look and which parts of the email they include. However, there is a security warning for user defined templates, which is why I didn't implement it, yet. Currently I'm waiting for feedback from the add-on reviewer. If there is positive feedback from the add-on reviewer, I will implement it and prepare a new version for testing.

The "trim regex" only operates on the email subject. The other parts of the note title are hardcoded. So it's unfortunately not possible to remove the recipient.

1 Like

Hi @Marph

Okay. Thank you for your explanations. We will wait for the proof of concept feedback :wink:
Good evening to you :smiley:.

To support Thunderbird 102, the add-on needs a new release. I prepared a release candidate.

The changes are briefly:

Feel free to test the release candidate and give feedback.

4 Likes

:star_struck: Fantastic!

Testing

  • Setup: Win10; TB 91.10 (x64 portable); Jopin 2.8.8 (portable)

  • Smooth install of add-on, paste token & save (connected), set parent folder & save, otherwise left default settings in place. Used an email with simple formatting and a single TXT file attachment. The note generated correctly and quickly in Joplin, with formatting and attachment as expected.

  • Tested same email with "Add header info" enabled. PASS

  • Tested as TODO with header info off, multiple tags separated by "comma", and with "Include Tags from Email" enabled - MINOR FAIL

  • Tested with different expression in "Trim subject" - FAIL

Comments

  • Documentation

    • Pretty good, well done.
  • Add Header Info (Note Header Setting)

    • Presume we are not stuck with your default layout.
    • You mention defining a template in the "Note header" setting.
    • Where is this found?
  • Tags

    • When edited directly in configuration works fine, eg. "email,tb". However...
  • Include Tags from Email

    • Very nice inclusion, well done. Unfortunately, i experienced a minor issue.
    • When using a low order tag, that came default with Thunderbird, it becomes $label1 in Joplin.
    • If i tap number "1" to tag an email as say "Important", the tag exports to my note as $label1.
    • When i tap the number "2" to tag as say "Waiting", the export tags as $label2.
    • If however i create my own tag, eg. a 7th one as "Rotation", then tap the number "7" to tag my email, it exports into Joplin correctly tagged as Rotation.
  • Trim Subject

    • Does this apply strictly to the value of "subject"?
    • I tried a custom regex across the whole string and it made no difference.
    • Whether the expression was "broken" or "valid", the title of my note in Joplin did not change.
    • I'm wondering, am i allowed to put say {{subject}} in the "Trim Subject" field?
    • Could i put say {{author}} ({{date}}), and end up with a note titled "Marph (7/7/2022)"?
    • Getting too complicated?
    • Perhaps a new "Note Title" setting that allows me to do such a thing?
    • After extracting my custom note title, then you would apply whatever regex i might have supplied.
    • If that were the case, perhaps the setting would be better titled "Trim Note Title".
    • Jolly software development. One little biddy tweak and BAMB! - thirty consequences!!!

Thank you very very much for your superb effort @Marph.


As an side... i couldn't <right-click> to paste my web clipper token into your add-on. I was about to report it to you, but fortunately tried the settings window of a different Thunderbird add-on. None of the settings windows for my add-ons respond to <right-click> to bring up the context sensitive menu. Go figure. Probably been like that for years!

2 Likes

Thanks for the detailed report @Zargron!

I think you did the tests with the add-on version 0.0.1 and not the release candidate for 0.0.2 (needs to be unzipped and installed manually). This might have caused some confusion.

The setting "Add Header Info" was removed. The new setting "Note header" is right at the settings page for the release candidate. The settings page should look like:

I will try to reproduce it. Might be a bug.

Yes, this applies only to the subject.

A working regex is ^(((Re|Fw|Fwd):|(\[.*\])) ?)* for example. Maybe you can try to adapt yours based on it. If there are further problems, you can post it and we try to get it to work. Regexes are always tricky.

No, "Trim Subject" purely regex. I think this and the following questions are caused by using the add-on version 0.0.1. They should resolved by the new settings "Note title" and "Note header" in the release candidate.

I'm always using Ctrl+V, so I didn't know :smiley: I will check if there is an option to add a context menu.

You are welcome :slight_smile: If I forgot to answer something, feel free to reference it again.

1 Like

Thanks for your excellent response @Marph. I used the release candidate you suggested.

  • Setup

    • Win10; TB 91.10 (x64 portable); Jopin 2.8.8 (portable)
    • Thunderbird Addon (dated 7/7/2022 still showing ver 0.0.1)
  • Testing

    • Installed release candidate over existing, replaced okay.
    • Used several different emails varying attachments/content and so forth.
    • Overall working well.
  • Note Title / Note Header

    • Both working
    • For "Header" i created markdown table with author, date, subject & tags
    • Tested on an email without subject, comes through neatly with a note title of "(No subject header)"
  • Suggestions for Note Title/Header

    • Documentation
      • perhaps remind users that header object reference is case sensitive
      • should be all lower case
    • {{date}}
      • any chance of getting this in short format?
      • for example, mine comes through as Thu Jul 07 2022 13:32:51 GMT+0930 (Australian Central Standard Time)
      • would be nice to have date formatted as for example: 7/7/2022
    • {{author}}
      • would love to be able to strip away email address
      • currently coming through as "Frank Harrodford <frankharrodford@example.com>"
      • when using your default, (eg. {{subject}} from {{author}}), it would be nice simply have "Joplin Rocks! from Frank Harrodford", without being suffixed with the email address.
  • Question - Inline Images

    • URL links to online images obviously coming through correctly.
    • How much work to bring inline images through as an attachment?
    • Currently there is no indication that an image has been left behind.
  • As an aside - drag & drop "inline image" from Thunderbird to Joplin

    • Without inline images being exported to Joplin, no big deal, i'll do it manually.
    • When i tried to drag & drop from TB to Joplin, an interesting thing happened.
    • When i dragged a PNG image from TB into Joplin, it converted it to BMP!
    • When i dragged from TB to windows explorer it saved as PNG.
    • When i dragged that image from explorer to Joplin, it correctly came through as PNG.
    • Ideas anyone?
  • Include Tags from Email

    • Working of course but with $label1 issue as previously described
  • Trim Subject

    • Working of course, (previous testing i was doing something silly)
  • Unable to <right-click> in add-on options

    • I suggest this is NOT a fault in your add-on and to not spend any time looking into it.
1 Like