forked from expresspigeon/expresspigeon-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 1cdbd01 Author: ipolevoy <[email protected]> Date: Tue Sep 18 23:56:41 2018 -0500 expresspigeon#22 Implement sending transactional messages with required and optional parameters commit 4174115 Author: ipolevoy <[email protected]> Date: Tue Sep 18 23:56:31 2018 -0500 expresspigeon#22 Implement sending transactional messages with required and optional parameters commit 4ec9064 Author: ipolevoy <[email protected]> Date: Tue Sep 18 11:01:18 2018 -0500 adding test to gitignore commit ad30b5f Merge: 7e15541 fc27903 Author: Igor Polevoy <[email protected]> Date: Mon Apr 30 08:47:27 2018 -0500 Merge pull request expresspigeon#21 from Fooda/SNAP-2445-increase-read-timeout SNAP-2445: Increase Net::HTTP Read Timeout commit 7e15541 Author: ipolevoy <[email protected]> Date: Mon Apr 30 08:07:33 2018 -0500 small script mods commit 6e309a5 Merge: 6bbde05 b41d26b Author: Igor Polevoy <[email protected]> Date: Thu Jan 25 15:44:03 2018 -0700 Merge pull request expresspigeon#20 from gsavvas/patch-1 Fix misspelling in Readme commit b41d26b Author: Adam <[email protected]> Date: Thu Jan 25 16:38:13 2018 -0600 Fix misspelling in Readme commit 6bbde05 Author: Igor Polevoy <[email protected]> Date: Sat Apr 29 18:55:45 2017 -0500 small script mods commit 534a0b5 Author: Igor Polevoy <[email protected]> Date: Thu Apr 6 17:48:06 2017 -0500 releasing 0.0.9 commit bd2e762 Author: Igor Polevoy <[email protected]> Date: Thu Apr 6 17:46:32 2017 -0500 added headers argument commit 63fd7b6 Author: Igor Polevoy <[email protected]> Date: Tue Feb 28 20:33:46 2017 -0600 added some missing APIs commit 3f4eee3 Author: Igor Polevoy <[email protected]> Date: Tue Feb 7 12:51:03 2017 -0600 removed PIGEON const from specs commit 517d823 Author: Igor Polevoy <[email protected]> Date: Wed Dec 14 15:50:47 2016 -0600 merge fields need to be sent as Json stirng instead of as individual parameters commit ce2db27 Author: Igor Polevoy <[email protected]> Date: Tue Nov 22 00:20:58 2016 -0600 copy commit 5be3ca2 Author: Igor Polevoy <[email protected]> Date: Fri Nov 18 13:55:19 2016 -0600 docs, typos commit 350418c Author: Igor Polevoy <[email protected]> Date: Fri Nov 18 13:49:37 2016 -0600 expresspigeon#19 Implement sending messages with attachments - added address suppression argument commit 79e5f22 Author: Igor Polevoy <[email protected]> Date: Tue Nov 8 15:02:06 2016 -0600 expresspigeon#19 Implement sending messages with attachments
- Loading branch information
1 parent
e1f8538
commit 350750d
Showing
27 changed files
with
620 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,12 @@ | |
.idea/ | ||
|
||
|
||
rspec.sh | ||
scripts/* | ||
|
||
set_env | ||
|
||
*.txt | ||
|
||
test/* | ||
|
||
expresspigeon-ruby-*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ruby-2.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Expresspigeon::Ruby | ||
|
||
This is a Ruby library for convenince access to [ExpressPigeon API](https://expresspigeon.com/api). | ||
This is a Ruby library for convenient access to [ExpressPigeon API](https://expresspigeon.com/api). | ||
|
||
## Installation | ||
|
||
|
@@ -16,11 +16,10 @@ Or install it yourself as: | |
|
||
$ gem install expresspigeon-ruby | ||
|
||
## Usage | ||
## Sending a simple message | ||
|
||
Sending a transactional message is easy: | ||
|
||
|
||
```ruby | ||
MESSAGES = ExpressPigeon::API.messages.auth_key 'XXX' | ||
message_response = MESSAGES.send_message 115, # template ID | ||
|
@@ -40,6 +39,50 @@ sleep 5 | |
puts MESSAGES.report message_response.id | ||
``` | ||
|
||
## Sending a message with attachments | ||
|
||
```ruby | ||
MESSAGES = ExpressPigeon::API.messages.auth_key(ENV['AUTH_KEY']) | ||
|
||
attachments = %W{attachments/attachment1.txt attachments/smile.pdf attachments/example.ics} | ||
|
||
puts MESSAGES.send_message( | ||
123, # template_id | ||
'[email protected]', #to | ||
'[email protected]', #reply_to | ||
"Jane Doe", #from | ||
"Want to get out for a dinner?", #subject | ||
{first_name: 'John', main_course: 'stake'}, #merge_fields | ||
false, #view_online | ||
true, #click_tracking | ||
true, #suppress_address | ||
attachments #file paths to upload as attachments | ||
) | ||
|
||
``` | ||
|
||
## Sending a message with all required and optional arguments | ||
|
||
```ruby | ||
|
||
MESSAGES = ExpressPigeon::API.messages.auth_key(ENV['AUTH_KEY']) | ||
|
||
attachments = %W{attachments/attachment1.txt attachments/calendar.ics} | ||
|
||
puts MESSAGES.send_msg 123, '[email protected]', '[email protected]', | ||
'Jane Doe', 'A simple test subject', | ||
merge_fields: { first_name: "John" }, | ||
view_online: false, | ||
click_tracking: true, | ||
suppress_address: false, | ||
attachments: attachments, | ||
headers: { Xtest: "test" }, | ||
reply_name: "Jane S. Doe", | ||
from_address: "[email protected]" | ||
|
||
``` | ||
|
||
The first five arguments are mandatory, while the rest are optional. | ||
|
||
## Contributing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.