authify-core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/authify/core/jobs/email.rb +9 -4
- data/lib/authify/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1978addbf478136a40cdf73afc7618a840f551f5
|
4
|
+
data.tar.gz: 1aa0eaf1b4d5a298fb1c755486368c66553dea5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 057299072b709a99f6166506b2dbf449eb5dd593c4dcda7cc8d2ff8d5cf280c2c1a162d04f26d5016568396002b1f0dd7aff769f50d2817d431282e24ea2e614
|
7
|
+
data.tar.gz: d31a3da6b20b38bd08a044c2af2e6e56684c3a1c40ee1c88358155fe21a0b5f714c663e768a7fde5925c940b1bf2db6c93712e269efba5e022ae8ecd28c380a7
|
@@ -4,7 +4,12 @@ module Authify
|
|
4
4
|
# A Resque job for sending email (using Pony)
|
5
5
|
class Email
|
6
6
|
@queue = :mailer
|
7
|
-
|
7
|
+
|
8
|
+
# Used by Resque to send email
|
9
|
+
def self.perform(to, subject, opts = {})
|
10
|
+
# Ensure opts keys are symbols
|
11
|
+
opts = opts.each_with_object({}) { |(k, v), h| h[k.intern] = v }
|
12
|
+
|
8
13
|
config = {
|
9
14
|
to: to,
|
10
15
|
from: CONFIG[:mail][:from],
|
@@ -12,9 +17,9 @@ module Authify
|
|
12
17
|
via_options: CONFIG[:mail][:server]
|
13
18
|
}
|
14
19
|
|
15
|
-
config[:headers] = headers if headers
|
16
|
-
config[:body] = body if body
|
17
|
-
config[:html_body] = html_body if html_body
|
20
|
+
config[:headers] = opts[:headers] if opts[:headers]
|
21
|
+
config[:body] = opts[:body] if opts[:body]
|
22
|
+
config[:html_body] = opts[:html_body] if opts[:html_body]
|
18
23
|
|
19
24
|
Pony.mail config
|
20
25
|
end
|
data/lib/authify/core/version.rb
CHANGED