No commit activity in last 3 years
No release in over 3 years
mail2frontmatter plugin for extracting tags from subject lines
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

 Project Readme

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: yourblogemail@yourdomain.com
senders:  yourpersonal@yourdomain.com

preprocessors:
  - key: 'autotag-subject'

mailman:
  server: imap.gmail.com
  port: 993
  ssl: true
  username: yourblogemail@yourdomain.com
  password: yourpassword

Usage

Now when you send an email to yourblogemail@yourdomain.com your subject line will be parsed for tags within brackets like:

to: yourblogemail@yourdomain.com
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