alphamail 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/LICENSE +0 -0
- data/README.rdoc +5 -5
- data/Rakefile +0 -0
- data/lib/alphamail.rb +0 -0
- data/spec/alphamail_test.rb +4 -4
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
2012-04-11 1.0.6 - Changed examples to api.amail.io.
|
data/LICENSE
CHANGED
File without changes
|
data/README.rdoc
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
This gem is the official client library for sending transactional emails with the cloud service AlphaMail.
|
6
6
|
To use this service you need an account. You can sign up for an free account on our website (http://www.comfirm.se).
|
7
7
|
|
8
|
-
This is not a service for sending SPAM,
|
8
|
+
This is not a service for sending SPAM, newsletters or bulk emails of any kind. This is for transactional emails exclusive. Read more about transactional emails on http://www.comfirm.se.
|
9
9
|
|
10
10
|
== Installation
|
11
11
|
|
@@ -39,7 +39,7 @@ Now, set the fields:
|
|
39
39
|
Where myPayload.body is the object that will be insertet into the email template. Make sure that the class has implemented the to_json method.
|
40
40
|
|
41
41
|
Setup the service:
|
42
|
-
myService = AlphaMail::EmailService.new 'http://api.
|
42
|
+
myService = AlphaMail::EmailService.new 'http://api.amail.io/v1', 'YOUR-TOKEN-HERE'
|
43
43
|
|
44
44
|
Replace YOUR-TOKEN-HERE with a valid token. You can crate new tokens at the dashboard under settings.
|
45
45
|
|
@@ -71,7 +71,7 @@ class NewMember
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
myService = AlphaMail::EmailService.new 'http://api.
|
74
|
+
myService = AlphaMail::EmailService.new 'http://api.amail.io/v1', 'YOUR-TOKEN-HERE'
|
75
75
|
|
76
76
|
am_res = myService.queue(AlphaMail::MessagePayload.new(
|
77
77
|
139, # Project ID
|
@@ -84,7 +84,7 @@ puts "#{am_res.error_code} #{am_res.message}"
|
|
84
84
|
|
85
85
|
== Error codes
|
86
86
|
|
87
|
-
The respond will be returned as an
|
87
|
+
The respond will be returned as an AlphaMailError object.
|
88
88
|
The AlphaMailError class contains following fields:
|
89
89
|
error_code
|
90
90
|
message
|
@@ -92,7 +92,7 @@ The AlphaMailError class contains following fields:
|
|
92
92
|
Possible values for error_code:
|
93
93
|
|
94
94
|
* 0 OK
|
95
|
-
* -1 Something
|
95
|
+
* -1 Something went wrong
|
96
96
|
* -2 Something else
|
97
97
|
|
98
98
|
== Author
|
data/Rakefile
CHANGED
File without changes
|
data/lib/alphamail.rb
CHANGED
File without changes
|
data/spec/alphamail_test.rb
CHANGED
@@ -41,7 +41,7 @@ end
|
|
41
41
|
# ---------------------------------------------------------
|
42
42
|
|
43
43
|
# The email content (in this case, member info)
|
44
|
-
myMember = NewMember.new('Ruby Diamond Ruben', '
|
44
|
+
myMember = NewMember.new('Ruby Diamond Ruben', 'p4sSw0rd')
|
45
45
|
|
46
46
|
# The payload, our new member along with some other things
|
47
47
|
myPayload = AlphaMail::MessagePayload.new
|
@@ -59,7 +59,7 @@ myPayload.body = myMember # The content of out email, our new member
|
|
59
59
|
|
60
60
|
# Create and setup a new email service
|
61
61
|
# Replace YOUR-TOKEN-HERE with your own token. You can create tokens in Dashboard
|
62
|
-
myService = AlphaMail::EmailService.new 'http://api.
|
62
|
+
myService = AlphaMail::EmailService.new 'http://api.amail.io/v1', 'YOUR-TOKEN-HERE'
|
63
63
|
|
64
64
|
# Now, the fun part, sending it!
|
65
65
|
am_res = myService.queue(myPayload)
|
@@ -71,14 +71,14 @@ puts "#{am_res.error_code} #{am_res.message}"
|
|
71
71
|
# Demo 2 --------------------------------------------------
|
72
72
|
# Shorthand: All the code above can be written in a shorter way.
|
73
73
|
# ---------------------------------------------------------
|
74
|
-
service_url = 'http://api.
|
74
|
+
service_url = 'http://api.amail.io/v1'
|
75
75
|
myToken = 'YOUR-TOKEN-HERE'
|
76
76
|
am_res = AlphaMail::EmailService.new(service_url, myToken).queue(AlphaMail::MessagePayload.new(
|
77
77
|
139, # Project ID
|
78
78
|
2, # Receiver ID
|
79
79
|
AlphaMail::Contact.new('Jack Sender', 'jack@example.com'), # Sender
|
80
80
|
AlphaMail::Contact.new('John Doe', 'john.doe@example.com'), # Receiver
|
81
|
-
NewMember.new('
|
81
|
+
NewMember.new('Ruby Diamond Ruben', 'p4sSw0rd') # Body object
|
82
82
|
))
|
83
83
|
# Print
|
84
84
|
puts "#{am_res.error_code} #{am_res.message}"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphamail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 6
|
10
|
+
version: 1.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jack Engqvist Johansson
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-04-11 00:00:00 +00:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|