| 1 | package Mojolicious::Command::sendgrid; | ||
| 2 | use Mojo::Base 'Mojolicious::Commands'; | ||
| 3 | |||
| 4 | has description => 'Sendgrid API'; | ||
| 5 | has hint => <<EOF; | ||
| 6 | |||
| 7 | See 'APPLICATION sendgrid help API' for more information on a specific | ||
| 8 | api. | ||
| 9 | EOF | ||
| 10 | has message => sub { shift->extract_usage . "\nAPI:\n" }; | ||
| 11 | has namespaces => sub { ['Mojolicious::Command::sendgrid'] }; | ||
| 12 | |||
| 13 | sub help { shift->run(@_) } | ||
| 14 | |||
| 15 | 1; | ||
| 16 | |||
| 17 | =encoding utf8 | ||
| 18 | |||
| 19 | =head1 NAME | ||
| 20 | |||
| 21 | Mojolicious::Command::sendgrid - Command interface to the Sendgrid API | ||
| 22 | |||
| 23 | =head1 SYNOPSIS | ||
| 24 | |||
| 25 | Usage: APPLICATION sendgrid ENDPOINT [OPTIONS] | ||
| 26 | |||
| 27 | export SENDGRID_APIKEY='your sendgrid api key' | ||
| 28 | mojo sendgrid mail send -t a@b.com -f x@y.com -s Subject < /tmp/file | ||
| 29 | |||
| 30 | =head1 DESCRIPTION | ||
| 31 | |||
| 32 | L<Mojolicious::Command::sendgrid> lists available Sendgrid endpoints. | ||
| 33 | |||
| 34 | =head1 ATTRIBUTES | ||
| 35 | |||
| 36 | L<Mojolicious::Command::sendgrid> inherits all attributes from | ||
| 37 | L<Mojolicious::Commands> and implements the following new ones. | ||
| 38 | |||
| 39 | =head2 description | ||
| 40 | |||
| 41 | my $description = $sendgrid->description; | ||
| 42 | $sendgrid = $sendgrid->description('Foo'); | ||
| 43 | |||
| 44 | Short description of this command, used for the command list. | ||
| 45 | |||
| 46 | =head2 hint | ||
| 47 | |||
| 48 | my $hint = $sendgrid->hint; | ||
| 49 | $sendgrid = $sendgrid->hint('Foo'); | ||
| 50 | |||
| 51 | Short hint shown after listing available sendgrid commands. | ||
| 52 | |||
| 53 | =head2 message | ||
| 54 | |||
| 55 | my $msg = $sendgrid->message; | ||
| 56 | $sendgrid = $sendgrid->message('Bar'); | ||
| 57 | |||
| 58 | Short usage message shown before listing available sendgrid commands. | ||
| 59 | |||
| 60 | =head2 namespaces | ||
| 61 | |||
| 62 | my $namespaces = $sendgrid->namespaces; | ||
| 63 | $sendgrid = $sendgrid->namespaces(['MyApp::Command::sendgrid']); | ||
| 64 | |||
| 65 | Namespaces to search for available sendgrid commands, defaults to | ||
| 66 | L<Mojolicious::Command::sendgrid>. | ||
| 67 | |||
| 68 | =head1 METHODS | ||
| 69 | |||
| 70 | L<Mojolicious::Command::sendgrid> inherits all methods from | ||
| 71 | L<Mojolicious::Commands> and implements the following new ones. | ||
| 72 | |||
| 73 | =head2 help | ||
| 74 | |||
| 75 | $sendgrid->help('app'); | ||
| 76 | |||
| 77 | Print usage information for sendgrid command. | ||
| 78 | |||
| 79 | =head1 SEE ALSO | ||
| 80 | |||
| 81 | L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>. | ||
| 82 | |||
| 83 | =cut |