Mail2FrontMatter::AutotagSubject

Mail2FrontMatter plugin for extracting tags from an email subject line by convention.

Installation

Add this line to your application's Gemfile:

gem 'm2fm-autotag-subject', require: false

And then execute:

$ bundle

Configuration

In your Mail2FrontMatter YAML configuration enable the plugin by adding it to your preprocessors:

protocol: imap
receiver: [email protected]
senders:  [email protected]

preprocessors:
  - key: 'autotag-subject'

mailman:
  server: imap.gmail.com
  port: 993
  ssl: true
  username: [email protected]
  password: yourpassword

Usage

Now when you send an email to [email protected] your subject line will be parsed for tags within brackets like:

to: [email protected]
subject: [revelations, thoughts] My Amazing Revelation Today
body:
  ...

AutotagSubject will add 'revelations' and 'thoughts' and remove it from the the title. So your metadata will look like:

{
  tags: ['revelations', 'thoughts']
  title: "My Amazing Revelation Today"
}

Which will later get transformed to YAML for your static site.

That's it!

Contributing

  1. Fork it ( https://github.com/[my-github-username]/m2fm-autotag-subject/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request