anicholson / obsidian-google-mail

Fetch emails to Obsidian (as markdown) from Gmail server
55 stars 4 forks source link

Feature: Parse tags and destination folder from Title/Body #8

Open egauthier opened 1 year ago

egauthier commented 1 year ago

This is awesome!! Thank you!

At the risk of being greedy, there are a couple other features that would be really cool as this matures. I know these are mostly outside the scope (e.g. require file munging and parsing) but could be some cool features.

thingnotok commented 1 year ago

Hi! Thank you for the proposals! All of them are really good ideas. Here's quick reply, I'll post more details after processing these in my spare time.!

  1. Post processing hook. The first one is a dangerous one 🤣. There're some plugins with user scripts/shell scripts support. I'll check first if this plugin can cowork with them.
  2. Delete on fetch. The API supports this (https://developers.google.com/gmail/api/reference/rest/v1/users.messages/batchDelete). Not shipping this one in the current release is for safety concern. But you asked, so it will soon be added as an option (with dangerous mark on it)
  3. I'm expecting users to set labels and filters on Gmail web client. They have well-designed UI to setup and test, and also, I try to reduce the plugin's access to the mail account as less as possible.
  4. Extract attributes like Destination and Tags from subject. Can you share what syntaxes you're using? So I don't need to design the syntaxes and can build this feature for your workflow.

    • tags

    • /Folder

    Thank you for the suggestions again! Please let me know if I mistake anything.

egauthier commented 1 year ago
  1. I completely understand the concern about the plugin going too far to enable nefarious activity.
  2. Cool. That is the very reason I set up an entirely separate email address for just use with Obsidian. Since I am sending it to myself, I will always have the copy in my sent folder from the source address.
  3. I will check that out. I did add a filter to add a label, but maybe the label isn't populated if it isn't visible if there are no current emails with that label?
  4. In the mail subject line. @Fold/subfolder but this could be a conflict with @person mentions used by other software.
    • Folders: I suppose slash could be the delimiter instead, but then may be confusing to non-Linux / non-Mac users. Perhaps the trigger character could be assignable in the plugin settings. Then the folder would always be delimited with slashes and be relative to the root (e.g. no leading slash, just "{trigger}Folder/subfolder". This way there won't be a conflict with dates in the form of 11/06/2022.
    • Tags: just a simple hashtag syntax would work I think. #tagname
egauthier commented 1 year ago

Now that I'm thinking more about this, just using the #hashtag syntax in the email ${Subject} , or in the {$Body} should filter right through to the note itself, no programming required. Maybe that is sufficient? It would be cool to strip them and put them in YAML, but really not required.

thingnotok commented 1 year ago

3. I will check that out. I did add a filter to add a label, but maybe the label isn't populated if it isn't visible if there are no current emails with that label?

all the labels (with or without mails) are fetched in my use. but the labels in the plugin UI are only fetched during the login process. So if you add the label after that, you may need to logout and login again.

thingnotok commented 1 year ago

as you say, the hashtags are identified in obsidian if they present in ${subject} or ${Body}. But I do think an option to set tags and folders in the subject line is a great idea too.

egauthier commented 1 year ago

Yes, I found this out. Logout and log back in, and there were my labels!

On Nov 6, 2022, at 6:49 PM, thingnotok @.***> wrote:

  1. I will check that out. I did add a filter to add a label, but maybe the label isn't populated if it isn't visible if there are no current emails with that label?

all the labels (with or without mails) are fetched in my scenario. but the labels in the plugin UI are only fetched during the login process. So if you add the label after that, you may need to logout and login again.

— Reply to this email directly, view it on GitHub https://github.com/thingnotok/obsidian-google-mail/issues/8#issuecomment-1304979859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGW4D4RMUXFJVCU6SCVSSDWHBNZ7ANCNFSM6AAAAAARX7EGSI. You are receiving this because you authored the thread.