alphamail 1.0.3 → 1.0.4.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +82 -0
- metadata +6 -5
- data/README +0 -0
data/README.rdoc
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
= The official AlphaMail Ruby gem
|
2
|
+
|
3
|
+
== Description
|
4
|
+
|
5
|
+
This gem is the official client library for sending transactional emails with the cloud service AlphaMail.
|
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
|
+
|
8
|
+
This is not an service for sending SPAM, news letter or bulk emails of any kind. This is for transactional emails exclusive. Read more about transactional emails on http://www.comfirm.se.
|
9
|
+
|
10
|
+
== Installation
|
11
|
+
|
12
|
+
This gem requires json:
|
13
|
+
|
14
|
+
# gem install json
|
15
|
+
|
16
|
+
Now, install alphamail:
|
17
|
+
|
18
|
+
# gem install alphamail
|
19
|
+
|
20
|
+
== Usage
|
21
|
+
|
22
|
+
First you need to require alphamail:
|
23
|
+
require 'rubygems'
|
24
|
+
require 'alphamail'
|
25
|
+
|
26
|
+
Create the payload:
|
27
|
+
myPayload = AlphaMailEmailMessagePayload.new
|
28
|
+
|
29
|
+
Now, set the fields:
|
30
|
+
# Set payload fields
|
31
|
+
myPayload.project_id = 139
|
32
|
+
myPayload.receiver_id = 1
|
33
|
+
myPayload.sender.name = 'Jack Sender'
|
34
|
+
myPayload.sender.email = 'jack@example.com'
|
35
|
+
myPayload.receiver.name = 'John Doe'
|
36
|
+
myPayload.receiver.email = 'john.doe@example.com'
|
37
|
+
myPayload.body = myMember
|
38
|
+
|
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
|
+
|
41
|
+
Setup the service:
|
42
|
+
myService = AlphaMailEmailService.new 'http://api.am1.comfirm.se/v1', 'YOUR-TOKEN-HERE'
|
43
|
+
|
44
|
+
Replace YOUR-TOKEN-HERE with a valid token. You can crate new tokens at the dashboard under settings.
|
45
|
+
|
46
|
+
Now it's time for magic:
|
47
|
+
am_res = myService.queue(myPayload)
|
48
|
+
|
49
|
+
Send the payload by calling queue. The respond object will be stored in am_res as showed above.
|
50
|
+
|
51
|
+
== Error codes
|
52
|
+
|
53
|
+
The respond will be returned as an AplhaMailError object.
|
54
|
+
The AlphaMailError class contains following fields:
|
55
|
+
error_code
|
56
|
+
message
|
57
|
+
|
58
|
+
Possible values for error_code:
|
59
|
+
|
60
|
+
* 0 OK
|
61
|
+
* -1 Something when wrong
|
62
|
+
* -2 Something else
|
63
|
+
|
64
|
+
== Author
|
65
|
+
|
66
|
+
Jack Engqvist Johansson <mailto:jack.johansson@comfirm.se>
|
67
|
+
|
68
|
+
== License
|
69
|
+
|
70
|
+
Ruby License, see the COPYING file included in the source distribution. The
|
71
|
+
Ruby License includes the GNU General Public License (GPL), Version 2, so see
|
72
|
+
the file GPL as well.
|
73
|
+
|
74
|
+
== Download
|
75
|
+
|
76
|
+
The latest version of this library can be downloaded at
|
77
|
+
|
78
|
+
* http://rubygems.org/gems/alphamail
|
79
|
+
|
80
|
+
Online Documentation should be located at
|
81
|
+
|
82
|
+
* http://docs.comfirm.se/ruby
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alphamail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 961915972
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
|
9
|
+
- 4
|
10
|
+
- pre
|
11
|
+
version: 1.0.4.pre
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Jack Engqvist Johansson
|
@@ -46,10 +47,10 @@ extra_rdoc_files: []
|
|
46
47
|
|
47
48
|
files:
|
48
49
|
- lib/alphamail.rb
|
49
|
-
- README
|
50
50
|
- Rakefile
|
51
51
|
- LICENSE
|
52
52
|
- CHANGELOG
|
53
|
+
- README.rdoc
|
53
54
|
- spec/alphamail_test.rb
|
54
55
|
has_rdoc: true
|
55
56
|
homepage: http://www.comfirm.se
|
data/README
DELETED
File without changes
|