Send Google Mail to Evernote

Evernote is a great system to organize your notes, and to remember everything. You often want to add email message to Evernote, for example to add it to a To-do list. Evernote makes this possible by providing an email address, to which you can forward other messages–they will then be added to your other notes. But you still have to tag them, and you may want to put them in a different notebook. This can also be done by appending notebook and tags to the subject line, but this takes time and you can easily make a typing mistaken.

The method described here makes it much faster and easier: simply drag tags and notebook to the message, that’s it. It is shown in this video, and you can click through to read how to make it work for you. The video is short, less than 40 seconds, but it should not take more time to forward the message and see the result.

How does it work?

Each Evernote account comes with a unique email address (like ‘myname.12345@m.evernote.com’) which can be used to add content via email. You can forward a message to this address to add it as a note to Evernote.

Here, the messages are forwarded by a Google Apps script. This script will run at regular intervals, and read the Gmail labels Evernote and its sublabels. It will forward the last message of each thread that has one of these labels to the Evernote email address.

If a sublabel of the Evernote label was attached, it is appended to the subject line with an ‘@’ prefix. Similarly, other labels are appended to the subject line with a ‘#’ prefix. Evernote will read this subject line and place the note in the indicated notebook and attach the given tags.

In a Google Docs spreadsheet, a log is kept to record all forwarded email messages.

After forwarding, the Evernote label or sublabel is removed, so the messages will not be forwarded again.

Set up the script

To make this work, you start by creating the same labels/sublabels in GMail that you also use as tags in Evernote. You don’t have to create all tags, only the tags that you plan to use from Gmail. Also create a label ‘Evernote’, and create sublabels for all notebooks that you plan use.

Now configure the script and have it run regularly:

  1. Go to gm2en.com,  You may have to authenticate and grant access to the script to run.
  2. Check or fill in your Evernote mail address
  3. Select the Evernote label–any message with this label, or  a sublabel, will be forwarded to Evernote.
  4. Optionally, change the interval with which your mail is checked. Keep in mind that there are quotas for accessing email and use of computer time, so don’t set it too often. If you receive error messages, you may need to check less frequently, and increase the time interval.
  5. Press Submit

Web interface Gmail to Evernote

That’s it. Now, if you assign the Evernote label to any message, within 15 minutes  (depending on the time you set in step 4), the message is added to Evernote, and the label removed from the message. You may have to refresh Evernote to see the new note.

Advanced options

Click on Show advanced options, to view and change these options.

Adding a default tag

If you have several Google accounts, you may want to distinguish mail forwarded from each account. This can be accomplished using a default tag, e.g. home for your private account, and work for work account. This way, you can keep them separate in Evernote.

The log sheet

When an email message is forwarded to Evernote, the script will write a line in this spreadsheet, containing the date, source (including the email address) and message (the adapted subject line). This will be helpful to track errors. The first time, this sheet is created automatically and the ID filled in here.

If you have several Google accounts, you can use the same log sheet for all accounts:
  1. Share the log sheet of one account with all other accounts,
  2. Copy the Log sheet ID from this account to all other accounts.

Multiple sign-in, number of accounts

If you use multiple sign-in, the link in the note back to the email may not work; select the number of multiple sign-in accounts that you use, so it will give alternative links that will work. See this post for a more extensive explanation.

If you set this value to 0, the link to the message in Gmail will not be shown.

Header fields

Email header fields are added to Evernote. In the note, you can see who send the email, to whom, and when. Other fields are also possible, by changing this line. This is a comma-separated list of the fields that will be shown.

By default the value is ’From, To, Cc, Date’. Fields are only shown if they have content, so if there are no Cc-addresses, this header field will not be shown. Other fields that you can include are: Bcc, ReplyTo, and Subject.

If you don’t want any header fields, set the value to an empty string, ”.

Header CSS

You can configure the CSS style for the header DIV, containing the header fields and the link(s). By default, it is set to ‘border-bottom:1px solid #ccc;padding-bottom:1em;margin-bottom:1em;‘ showing a light-grey line between the header and the message. You can change this value here.

Tag label

By default, when no label is specified here, all labels except the notebook (sub)labels will be sent as tags to Evernote. If you specify a label here, only this label and its sublabels will be sent as tags

Sent label

If a label is specified here, it will be assigned after a message is sent to Evernote. It must be different than the notebook label, but may be a sublabel of it.

Manual configuration

You can also manually configure the script.

  1. Open the script at gm2en.com/script.
  2. Go to Resources - Current script’s triggers, and edit the trigger, or remove it to stop the script from forwarding messages to Evernote
  3. All other settings are stored as so-called User properties. To access the User properties, open the script at gm2en.com/scriptthen go to FileProject properties, and click on the User properties tab.
userproperties2

Notes

  • Labels in Gmail are assigned to threads, not to individual messages. This script will take the last message of a thread and forward only that message.
  • The Evernote label, or any of the notebook sublabels actually triggers the forwarding. After forwarding, these labels are removed from the thread, to avoid forwarding multiple times. If you assign multiple notebook labels, the message will be forwarded multilple times and placed in each notebook once.
  • If you want to add a remark to an email message before forwarding, you can forward the message to yourself, and add the text, before adding the labels.
  • It is safest to assign the tag labels first, and the notebook label last; Otherwise, it might happen that the script runs just after you added a notebook label, and does not copy the tag labels that you might insert later.
  • Using Gmail filters, you can automatically assign labels to incoming mail. In combination with this script, you can forward message from certain senders or with a given subject line directly to a selected notebook in Evernote, with the appropriate tags.

If you encounter any problems in getting the script to work, or have suggestions on how it can be used or improved, please add a comment!

 

This post is also available in: Dutch

93 thoughts on “Send Google Mail to Evernote

  1. Vince Schneider

    Harry. Great Job. This is exactly what I was looking for. I installed your script then created a filter in gmail that applies the label equivalent to my Evernote notebook and my emails magically import to the correct Evernote notebook.

    You have inspired me. I am going to start writing my own google scripts.

    Reply
  2. CJ de Heer

    Great script, but since the forwarded emails lose their original formatting (which I realize is a constraint of gmail), I’ve decided not to use it. How can I delete the installed scripts?

    Thanks

    Reply
    1. Harry Post author

      Hi,
      What do you mean by “lose their original formatting”? It may be some of your settings, but for me, forwarded email looks exactly like the original.
      In any case, the script is hosted by Google, there is nothing to uninstall. You can stop the script from running and checking your mail by going to http://gm.en.com/ and set the trigger time to 0

      Reply
    1. Harry Post author

      You can apply the Evernote label to all incoming mail using a filter (e.g. specify ‘deliveredto:user@example.com’ (replace this with your email address) as the search term).

      Reply
  3. Doug Renz

    Hi Harry, I’m trying to get this script to work and nothing happens, what should I look for to fix it?

    thank you,
    Doug R.

    Reply
    1. Harry Post author

      The general approach if it does not work, is to:

      1. Carefully read through the steps and double-check whether you understood and applied them correctly; if in doubt, remember this for the next step.
      2. If this did not resolve, get support; perhaps a friend or colleague, or you can contact me: do provide details, the steps that you were not sure about, the labels you used in GMail, the settings in the script, the names of notebooks and tags in Evernote, and the log sheet. You can use screenshots–please copy them all in a Google Drive folder and share that folder in the contact form
      Reply
  4. Sellaro

    Harry

    Thank you for this great script!

    I am testing it and I believe I found a bug (or I am doing something wrong). The resulting message on Evernote is being named wrongly. This is the scenario:

    1. I have created a label Evernote with a sub label @Archive
    2. I have configured gm2en in such a way that Evernote is the “base” label it will look for
    3. I have not configured any Default Tag on Advanced options

    Whent I label a message on Gmail with the Evernote/@Archive tag, the message is correctly processed and sent to the Archive Evernote notebook. The message subject, however, is amended to contain whatever other Gmail labels the message has. So, for example, a message whose subject is “Test” is filed into Evernote’s Archive notebook with a title “Test @#whatever-other-gmail-label-the-message-had”

    What am I doing wrong?

    On another token, as a suggestion, it would be fantastic if using advanced options a user could request that full headers be sent to Evernote as well.

    Thanks in advance

    Reply
    1. Harry Post author

      Thanks for the feedback, Sellaro!

      On labels: what you describe, is not a bug, but a feature :)

      Existing Gmail labels (outside of the Evernote label and its sublabel) are indeed appended to the subject line; if they are an existing Evernote tag, they will be removed from the subject line and the tag assigned to the message.
      If you often use GMail labels that are not tags in Evernote, you can restrict this feature.

      1. Create a top-level Gmail label (e.g. EvernoteTags) and create sublabels for the labels that are also tags in Evernote
      2. In the setup (gm2en.com), show the advanced options, and select this label as the Tag label

      Now only labels under this tag label will be appended to the subject line.

      On headers: you can also select which headers will be sent to Evernote. By default, aside from the Subject, only From, To, CC and Date, but you can also add Bcc and ReplyTo. Are there specific headers that you have in mind?

      Reply
  5. Bill Lee

    Hey, Harry. Love your script and have been using it for a while to auto-file into evernote some incoming receipts, etc.

    I’m trying, however, to use it or a modification of it to do something else I’d really like to have. On my android phone I can say “Note to Self’ and trigger an email with that subject and whatever I say next as the body which goes into my inbox. I’d like to change the subject of that email to whatever is in the body and then forward it to my ToodleDo account so that I create a new Todo. To the subject of that email (i.e. the body of the original) I’d want to add #Inbox so that it shows up in my “To be processed” section of ToodleDo.

    Anyway you can help me? I know next to nothing about scripts, but did get your original evernote script to work well. I’m certain a number of ToodleDo users would like this as well. Would be glad to post on their forums anything you come up with.

    Thanks.

    Reply
    1. Harry Post author

      Hello Bill,

      I don’t use ToodleDo myself, but from what I read here (http://www.toodledo.com/info/help_email.php), you can use the script as well.

      1. Use the ToodleDo email address instead of the Evernote address
      2. Notebook labels in Gmail will become Contexts in ToodleDo
      3. Other labels in Gmail will be interpreted as Due dates in ToodleDo

      Hope this helps, be happy to hear your experiences.

      Reply
    1. Harry Post author

      The limit of 20 triggers should not be a problem, as there is only one trigger for this script. The relevant quotas and limitations are:

      • Email recipients per day (100/day or 1,500/day, depending on your account)
      • Triggers total runtime (1, 3, or 6 hr/day)
      • Gmail read (10,000/day, can’t imagine this poses a limit in practice)
      • Properties write (50,000/day, but this is really theoretical)

      From the feedback I get, the first limitation is most often encountered, especially when all mail is forwarded, or a batch operation is done to forward large numbers of older messages.

      Reply
      1. Jeppe Madsen

        Thanks for the reply,

        It stopped forwarding after exactly 20 mails (checked the log), which I why I assumed that the trigger quota was the problem. After pressing Submit at gm2en.com, I got a 500 error from Google Drive (Google Drive encountered an error) when it does a POST to https://script.google.com/macros/s/….

        BUT! After waiting patiently all day, it has now started working again. I had gone from 5 minute intervals, to 1 minute intervals, which must have been the issue. If the script spends more than 2,5 seconds to execute, the 1 hour cap could be reached in 24 hours. Couldn’t that be the case?

        Cheers – and thanks again for this excellent script.

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *