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

138 thoughts on “Send Google Mail to Evernote

  1. Ryan

    Oh, I see. So is it only the Evernote label that is supposed to be removed? I thought the other labels were supposed to be removed too (all the labels I added for tags).

    Reply
  2. Keiko

    Hi Harry,

    Thank you for such an awesome script! I think it has a myriad of possibilities.

    Do you know if there is anyway to automatically set the “Created” date in Evernote to reflect the timestamp of the original email? I hesitate sending batches of old emails to Evernote due to A) them getting mixed up temporally or B) having to manually edit the timestamps.

    Also, on a less important note, there any way that I could change the time stamp on the log/script to a time zone other than Paris?

    Thanks!

    Reply
    1. Harry Post author

      Hi Kelko,
      The script can not change the date in Evernote, it has no access to your Evernote account, only sends email to the corresponding address.
      Regarding the timezone, I would have to explore the issue; later.

      Reply
  3. Steve

    Thanks Harry!

    It would be useful to allow stripping of the other tag labels as well in Gmail. I find that after the email is forwarded to EN I use EN to rearrange tags as needed, and then of course the labels assigned to the original email in Gmail are out of sync anyways with EN.

    Best,
    Steve

    Reply
    1. Harry Post author

      Hi Steve,

      I see your point, but wonder how widely used this approach is; if you’re going to tag in EN anyway, why bother to assign tags in Gmail already, except for the Notebook tag?

      Kind regards,
      Harry

      Reply
  4. Jayphen

    Brilliant, thanks very much for this script.

    Is it possible to archive messages after they have been processed?

    Reply
    1. Harry Post author

      You can archive messages after assigning the labels, there is no need to wait until they have been processed.

      Reply
  5. Lindsey Holmes

    Hi Harry. Thank you for the script. I do have one suggestion… In addition to your script I also use InQloud (inqloud.net). This app lets you send directly to an Evernote notebook. It would be great to be able to use one of the InQloud addresses so that our folder could trigger a transfer right into our preferred notebook. I am unsure if we can use the script for multiple notebooks (or just one?) but this would be super productive. Thanks again!!

    Reply
  6. Lindsey Holmes

    Actually Harry I see. I didn’t realize that you were using the Evernote subject equation for sending. The only thing that I am finding with that is, if your notebook name has a space, then it won’t work. i.e. ‘Follow Up’ vs FollowUp. It posts @Follow_Up so it doesn’t work.

    Reply
    1. Harry Post author

      Hi Lindsey,
      Thanks for the feedback! As you have noticed already, you can send directly to a different notebook than the default one.
      The script does not change the tag used, so if Gmail does not allow spaces in a label name, or translates them in an underscore, the script can not change that. So the only workaround I see is to avoid using spaces in the name of a notebook. Just wondering, would Evernote recognize a notebook, when you send an email with a subject line including ‘@Follow up’, or would it search for a notebook @Follow? Never tried that myself.

      Reply
  7. Bob

    Harry,
    Thanks for making this script available…I think it is what I have been wanting to automate some of my GMail workflow.

    One question: I have filters to assign the Evernote label when the email comes in. Is there a way to have the email forwarded to a specific notebook? I know you can do it by adding parameters to the subject line but I do not know how to do it with the script.

    Sorry if I am missing something basic.
    Bob

    Reply
    1. Harry Post author

      Hi Bob,
      Yes, this is possible. If you create a label with the name of the notebook as a sublabel of the Evernote label, and adapt the filter to assign that sublabel instead of the Evernote label, it will forward to that notebook.

      Reply
  8. Ian

    Hi Harry — Thanks for doing this script. I am excited about using it, but when I click the link to install/authorize the script, nothing seems to happen… I did get an email in my gmail, telling me I’d authorized a script, and giving me an “uninstall” button, but I don’t see any place where I can configure or access the script. It is probably ignorance on my part — I’ve never used a gmail script before. Where do I start? How do I find the dialogue that you show in your above instructions, where you enter the Evernote address, etc.? I just don’t know where to begin.

    Thank you!

    Reply
  9. Ian

    Also, I have a free gmail account as well as a google apps account. For some reason, the email following up on the script is going to my free gmail account, even though I selected the google apps account in connection with approving the script — does this mean I won’t be able to use it on the other account? Thank you!

    Reply
    1. Harry Post author

      If you have multiple e-mail accounts, make sure you authorize with the intended account. If you have used the wrong account, you can follow the instructions in the mail from Google to “uninstall” the script (meaning: withdraw the authorization).
      You can also use it for multiple accounts, just make sure you do the authorization and setup when logged in with each account separately. If you use the Chrome browser, it helps to use different users, see https://support.google.com/chrome/answer/2364824

      Reply
  10. Chris

    Is there a way to manually trigger? I think I have exceeded my quota for the day but still want to test.

    Reply

Leave a Reply

Your email address will not be published.