10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/lipwig/cli.rb', line 10
def call
case command
when 'send'
Lipwig::Senders.call email
when 'preview'
Lipwig::Preview.call email
when 'clear'
Dir['lipwig-preview-*.html'].each { |file| File.delete file }
else
puts "Unknown command #{command}." unless command == 'help'
puts <<-MESSAGE
Commands are:
send: Send the email to the specified recipients.
preview: Open the HTML for the email in your browser.
clear: Remove temporary preview files.
Example Usage:
$ lipwig send email.markdown
$ lipwig preview email.markdown
Sending emails requires LIPWIG_POSTMARK_API_KEY to be set. Recipients are
whatever is set in the email's frontmatter, but can be overridden by
LIPWIG_RECIPIENTS.
MESSAGE
end
end
|