volt-mailer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/mailer/tasks/mailer_task.rb +6 -1
- data/lib/volt/mailer/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: ac84cefe672745a926338885673a025532738ba1
|
4
|
+
data.tar.gz: 174a2ded619a67af01da3cae548be84349a1b32a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63d219d0d83e2959f5415061ff1b5a6db25888194e0f060938a63a60d685f9f5a2dc900304ad5a7d28b9a10b5dbb496298851a08a1169cd74a66b6db3c57e4f2
|
7
|
+
data.tar.gz: ec322d89bcd242c4ee165938471d9ed16f0ab5a4886efbe0c1caa0ef5d3de7ceac400adfea246ec17c173cb56faee6b03046216464e8f5751e0ec284bc4df224
|
@@ -5,6 +5,8 @@ end
|
|
5
5
|
|
6
6
|
class Mailer < Volt::Task
|
7
7
|
def deliver(view_path, attrs)
|
8
|
+
attrs = attrs.symbolize_keys
|
9
|
+
|
8
10
|
raise ":to must be supplied when delivering e-mail" unless attrs[:to]
|
9
11
|
|
10
12
|
subject = Volt::PathStringRenderer.new("#{view_path}/subject", attrs).html
|
@@ -33,12 +35,15 @@ class Mailer < Volt::Task
|
|
33
35
|
attrs[:body] = text
|
34
36
|
|
35
37
|
# Merge attrs into a copy of the mailer options
|
36
|
-
attrs = Volt.config.mailer.dup.merge(attrs) if Volt.config.mailer
|
38
|
+
attrs = Volt.config.mailer.to_h.dup.merge(attrs) if Volt.config.mailer
|
37
39
|
|
38
40
|
allowed_opts = Pony.permissable_options
|
39
41
|
|
40
42
|
pony_options = attrs.select {|k,v| allowed_opts.include?(k.to_sym) }
|
43
|
+
|
41
44
|
# Send the e-mail
|
42
45
|
Pony.mail(pony_options)
|
46
|
+
|
47
|
+
true
|
43
48
|
end
|
44
49
|
end
|
data/lib/volt/mailer/version.rb
CHANGED