sendgrid_cli_mailer 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -6
- data/bin/sg_cli +1 -2
- data/lib/sendgrid_cli_mailer/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -25,14 +25,11 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
You can send a message with a body specified via arguments:
|
27
27
|
|
28
|
-
|
28
|
+
sg_cli mail --from 'admin@yourjoint.com' --to 'hank@me.com' --subject 'Testing CLI' --body 'Short Body' --user 'sg@foo.com' --key '1234'"
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
cat /some/file | sg_mailer mail --from 'admin@yourjoint.com' --to 'hank@me.com' --subject 'Testing CLI' --user 'sg@foo.com' --key '1234'"
|
33
|
-
|
34
|
-
NOTE: if you supply both the STDIN will win.
|
30
|
+
OR use your body input in other ways like so:
|
35
31
|
|
32
|
+
sg_cli mail --from 'admin@yourjoint.com' --to 'hank@me.com' --subject 'Testing CLI' --user 'sg@foo.com' --key '1234'" --body `cat /etc/hosts`
|
36
33
|
|
37
34
|
|
38
35
|
## Contributing
|
data/bin/sg_cli
CHANGED
@@ -12,8 +12,7 @@ class SendgridCliMailerCommand < Thor
|
|
12
12
|
method_option :subject, :aliases => "-s", :desc => "Email 'subject'", :required => true
|
13
13
|
method_option :body, :aliases => "-b", :desc => "Email 'body'", :required => false
|
14
14
|
def mail
|
15
|
-
|
16
|
-
body = stdin_body || options.body || "No Message Body"
|
15
|
+
body = options.body || "No Message Body"
|
17
16
|
SendgridToolkit::Mail.new(options[:user], options[:key]).send_mail :to => options[:to], :from => options[:from],
|
18
17
|
:subject => options[:subject], :text => body
|
19
18
|
end
|