chimplate 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/LICENSE.md +20 -0
  2. data/lib/chimplate/version.rb +1 -1
  3. data/readme.md +100 -0
  4. metadata +3 -1
data/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Matt White, BitForge, LLC
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a
4
+ copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included
12
+ in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +1,3 @@
1
1
  module Chimplate
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/readme.md ADDED
@@ -0,0 +1,100 @@
1
+ Chimplate - Easy MailChimp user template updating
2
+ =================================================
3
+
4
+ What is it?
5
+ -----------
6
+
7
+ I've found myself doing a lot of template editing for clients lately,
8
+ and though Mailchimp's excellent in-browser editing tools make it easy
9
+ to get up and running, they don't provide any of the tools required for
10
+ managing a large number of with lots of common elements, managing
11
+ revisions, etc, etc.
12
+
13
+ There are tons of tools available to make this process easier, chiefly
14
+ git. I wanted to have all of the templates stored in a git repo so I
15
+ could track changes to each file, generate patches to apply to similar
16
+ templates, etc, but the process of making local modifications and then
17
+ copying and pasting into Mailchimp's template window was a major pain.
18
+ As a result, I would get lazy and make edits directly in the editor
19
+ window, and then version tracking goes out the window.
20
+
21
+ Solution?
22
+ ---------
23
+
24
+ I thought a tool to automatically push and pull templates from local
25
+ text files into Mailchimp templates in would be a good
26
+ solution, so Chimplate was born. I also added live update support
27
+ similar to `compass --watch`, so that Mailchimp will be updated on the fly
28
+ as you change files on your disk. Now you can use your favorite local
29
+ editor, save the files, and see the live changes in Mailchimp, all super
30
+ fast!
31
+
32
+ Usage
33
+ =====
34
+
35
+ Install chimplate via `gem install chimplate`.
36
+
37
+ Chimplate relies on the mailchimp gem, which requires Ruby 1.9+, so
38
+ you'll need a more up to date ruby than ships on OSX, unfortunately.
39
+ Homebrew can help you with that, or rvm or rbenv.
40
+
41
+ Next, make a project folder you'd like to work from. This folder should
42
+ be dedicated to only the templates for a single MC account, because the
43
+ folder-wide config file will store that account's API key.
44
+
45
+ In that folder, run `chimplate setup --api_key YOUR_API_KEY --name
46
+ "Project Name"`
47
+
48
+ This will write a .chimplate file to that directory which stores that
49
+ info.
50
+
51
+ Now:
52
+
53
+ 1. To retrieve existing templates on that account, run `chimplate pull`.
54
+ That will pull down all of the user templates in that account.
55
+ 2. Make a change in one or more files, and run `chimplate push`. This
56
+ will update the templates in your account.
57
+ 3. Run `chimplate watch`. This will watch for changes to the html files
58
+ in this directory, and update Mailchimp on the fly as they are
59
+ updated.
60
+
61
+ All of the files are stored with a specific file format, as follows:
62
+ template_id-template_name.html. So if you have a template that has an ID
63
+ in mailchimp of 12345, and the name is "My Cool Template", when you run
64
+ a `chimplate pull`, you will get a file named
65
+ `12345-My_Cool_Template.html`. Ideally you shouldn't change these
66
+ filenames manually, as that could cause issues syncing up with the same
67
+ file in MailChimp. Most importantly, don't change the format, or the ID,
68
+ as that's the primary identifier between MailChimp and your local copy.
69
+
70
+ New Files
71
+ ---------
72
+
73
+ Now that you know about the format, you can create a totally new
74
+ template locally and push it to MailChimp. To do so:
75
+
76
+ 1. Create a new html file with your template content in the same folder,
77
+ with a filename in the format of: "new-My_Template_Name.html". The
78
+ "new" flags it as a new template.
79
+ 2. Run `chimplate push`. This will create a new template in MailChimp
80
+ with the name of "My Template Name". It will also rename your local
81
+ copy to contain the ID of the new template, so it will look like
82
+ "12345-My_Template_Name.html". From that point on, you can edit it as
83
+ normal.
84
+
85
+ Note: When making new files the watch option doesn't work. So if you
86
+ want to create a new file, kill the watch process via Ctrl+C, make the
87
+ new file, run `chimplate push`, and then re-start the `chimplate watch`
88
+ process to resume pushing your changes on the fly back to Mailchimp.
89
+
90
+ TODO
91
+ ----
92
+
93
+ 1. Write some tests.
94
+ 2. Better error handling. At this point if you mess up a filename so that
95
+ it doesn't match the expected format Chimplate will probably give you a nasty
96
+ stack trace and run home to mommy. Sorry! I hope to fix this soon...
97
+ 3. Provide some sort of support for template deletion. At this point I'm
98
+ happy leaving it to the Mailchimp UI, since accidental deletion would be
99
+ a pain. But since we have local copies now, it wouldn't be too bad! Git
100
+ FTW!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chimplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -86,11 +86,13 @@ files:
86
86
  - .gitignore
87
87
  - Gemfile
88
88
  - Gemfile.lock
89
+ - LICENSE.md
89
90
  - bin/chimplate
90
91
  - chimplate.gemspec
91
92
  - lib/chimplate.rb
92
93
  - lib/chimplate/base.rb
93
94
  - lib/chimplate/version.rb
95
+ - readme.md
94
96
  homepage: http://bitforge.us
95
97
  licenses: []
96
98
  post_install_message: