gmail-mailer 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +3 -0
- data/README.md +9 -0
- data/VERSION +1 -1
- data/gmail-mailer.gemspec +1 -1
- data/lib/gmail-mailer.rb +1 -1
- metadata +2 -2
data/Changelog.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# gmail-mailer Changelog
|
2
2
|
|
3
|
+
### 0.4.2
|
4
|
+
* Made error messages for credentials more detailed
|
5
|
+
|
3
6
|
### 0.4.0
|
4
7
|
* Added further validation on the `to` field
|
5
8
|
* Added ability to pass an array into the `to` field which will convert the `to` to a semi-colon delimited string
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
Programatically send emails using a given gmail account. No username/passwords needed, just use your OAUTH credentials
|
2
2
|
|
3
|
+
## Information
|
4
|
+
This has only been tested on ruby 1.9.2
|
5
|
+
|
3
6
|
## Usage
|
4
7
|
### Creating a message
|
5
8
|
message = GmailMailer::Message.new("to", "Hello Subject", "Hello Body")
|
@@ -9,6 +12,12 @@ Programatically send emails using a given gmail account. No username/passwords n
|
|
9
12
|
|
10
13
|
### Setting up gmail-mailer
|
11
14
|
You will need to provide mailer with a hashmap containing the ouath details for your account.
|
15
|
+
email_credentials =
|
16
|
+
{
|
17
|
+
:smtp_oauth_token=>"<your outh_token>",
|
18
|
+
:smtp_oauth_token_secret=>"<your ouath token secret>",
|
19
|
+
:email=>"<your gmail address>"
|
20
|
+
}
|
12
21
|
|
13
22
|
### Sending a message
|
14
23
|
mailer.send(message)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
data/gmail-mailer.gemspec
CHANGED
data/lib/gmail-mailer.rb
CHANGED
@@ -9,7 +9,7 @@ module GmailMailer
|
|
9
9
|
class Mailer
|
10
10
|
def initialize(credentials)
|
11
11
|
result = validate_credentials(credentials)
|
12
|
-
raise ArgumentError, result if result.nil? == false
|
12
|
+
raise ArgumentError, "ERROR: Email credentials are invalid: -\n\n - #{result}" if result.nil? == false
|
13
13
|
@email_credentials = credentials
|
14
14
|
end
|
15
15
|
|