Skip to content

marph91/thunderbird-joplin-export

Repository files navigation

Joplin Export Thunderbird Addon

Easily export your Thunderbird emails to Joplin.

build test codecov

Features

  • Export a text selection, a single email or multiple emails to Joplin.
  • Export by clicking the button or pressing the hotkey (by default "Ctrl+Alt+J")
  • Export the email as note or todo.
  • Add metadata to the title and body of the note:
    • Set a template for note title and body.
    • Trim the author or subject by regex. For example, remove "Re:" or "Fwd:".
    • Include the date in a custom format.
    • Take a look at this section for details.
  • Add tags and attachments from the email.

Installation

Usage

  1. Start Joplin.
  2. Enable the webclipper and copy the API token.
  3. Configure the plugin:
  4. Paste the API token to the token field.
  5. Save
  6. Refresh the available notebooks by pressing the small update button.
  7. Select a destination notebook.
  8. Save
  9. Select any email. The Joplin button should be at the menu.
  10. Export the email by clicking the button. If there is any problem, a notification will pop up. After a successful export, the email should be in the specified Joplin notebook.
joplin_addon_setup.mp4

Include metadata

In this section you will find some examples how to include email metadata into note title or body. All metadata of the mail header object can be used.

By default, the note title template is {{subject}} from {{author}}. I. e. the subject and author keys are searched in the mail header object and inserted into the template if found. Since the subject contains often strings like Re: or Fwd:, these can be removed by defining a regex. The setting is called "Trim subject". For me, the regex ^(((Re|Fw|Fwd):|(\[.*\])) ?)* works best.

It is also possible to insert some metadata at the top of the note body. This can be done by defining a template in the "Note header" setting. The template should be specified in markdown syntax. Words surrounded by double curly brackets will be attempted to be replaced by the corresponding metadata, as done in the note title.

The following two code snippets show examples of what the templates might look like.

Plain text with closing separation line:

From: {{author}}
Subject: {{subject}}
Date: {{date}}
To: {{recipients}}

---

Table with closing separation line:

|         |                |
| ------- | -------------- |
| From    | {{author}}     |
| Subject | {{subject}}    |
| Date    | {{date}}       |
| To      | {{recipients}} |

---

Troubleshooting

What to do when the export failed?

  1. Check that Joplin is running and the webclipper is enabled.
  2. Check that the plugin is configured correctly. There is a status field. The status should be "working". Make sure the API token is set correctly.
  3. Check the developer console. Usually it can be opened by pressing "Ctrl + Shift + I" or going to "Extras -> Developer Tools". There should be some error message.
  4. If the previous steps didn't resolve the issue, you can open a github issue or email me.

Related Projects

Further ressources

Changelog

master

  • Add author and user_created_date metadata.
  • Add support for Thunderbird up to version 127.

0.0.5

  • Add support for Thunderbird 117 (#22).

0.0.4

  • Add export via context menu (#21).

0.0.3

  • Add custom author and date (#16).
  • Fix naming of the default tags (#18).

0.0.2

  • Add user defined note title (#9).

0.0.1

  • Initial release.