volt-mailer 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -8
- data/{app/mailer/tasks/mailer_task.rb → lib/volt/mailer/mailer.rb} +2 -4
- data/lib/volt/mailer/mailer_task.rb +7 -0
- data/lib/volt/mailer/version.rb +1 -1
- data/lib/volt/mailer.rb +1 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4443ba2cab47ae8310de857d279a1429adc4812
|
4
|
+
data.tar.gz: 483ac8ed5d0b1e881956dcfad7b7fda56e4fa97a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b83d122290d4e269fa0e014d35138fa3dfc54d104b1afeea72cace4acf7c3daa0dac055f2534543f34263d64e3fe5188facdc694efd6046e96d780a5f70c59
|
7
|
+
data.tar.gz: 7980a20f309ae3f729bf1d093113cefa51acb361d1a0f4a15430d82b089200ee8c0ac09e8c10dff4a36a32cb49f18f848560c1fd1e03edf375e52b74f340dc0a
|
data/README.md
CHANGED
@@ -38,22 +38,16 @@ Welcome
|
|
38
38
|
|
39
39
|
## Delivery
|
40
40
|
|
41
|
-
On the
|
41
|
+
On the the server you can send an e-mail with:
|
42
42
|
|
43
43
|
```ruby
|
44
|
-
Mailer.deliver('path/to/views', {to: 'someone@address.com'})
|
45
|
-
# email sent
|
46
|
-
end.fail do |errors|
|
47
|
-
# failed to send, handle errors
|
48
|
-
end
|
44
|
+
Mailer.deliver('path/to/views', {to: 'someone@address.com'})
|
49
45
|
```
|
50
46
|
|
51
47
|
Mailer.deliver takes two arguments, the path to your mailer and a hash of options. In a new volt project, there will be an "app/main/views/mailer" folder. Any view with .email (or .html) can be used. Normally you would use a .email view. Views with the .email extension will not be loaded on the client.
|
52
48
|
|
53
49
|
If you skip the :Html section, the :Text section will be used for the html e-mail.
|
54
50
|
|
55
|
-
The ```Mailer``` class is a Volt::Task, so the deliver method returns a promise. Be sure to handle the fail.
|
56
|
-
|
57
51
|
The second argument is a hash of options. volt-mailer uses the [pony gem](https://github.com/benprew/pony) under the hood to deliver the mail. Any supported pony options will be passed to pony during the sending. All options passed in will be exposed as methods inside of the email template. If a matching controller is provided, the options will be set as the controllers model.
|
58
52
|
|
59
53
|
## Attachments
|
@@ -3,8 +3,8 @@ unless RUBY_PLATFORM == 'opal'
|
|
3
3
|
require 'volt/page/path_string_renderer'
|
4
4
|
end
|
5
5
|
|
6
|
-
|
7
|
-
def deliver(view_path, attrs)
|
6
|
+
module Mailer
|
7
|
+
def self.deliver(view_path, attrs)
|
8
8
|
attrs = attrs.symbolize_keys
|
9
9
|
|
10
10
|
raise ":to must be supplied when delivering e-mail" unless attrs[:to]
|
@@ -43,7 +43,5 @@ class Mailer < Volt::Task
|
|
43
43
|
|
44
44
|
# Send the e-mail
|
45
45
|
Pony.mail(pony_options)
|
46
|
-
|
47
|
-
true
|
48
46
|
end
|
49
47
|
end
|
data/lib/volt/mailer/version.rb
CHANGED
data/lib/volt/mailer.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt-mailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
@@ -64,8 +64,9 @@ files:
|
|
64
64
|
- README.md
|
65
65
|
- Rakefile
|
66
66
|
- app/mailer/config/dependencies.rb
|
67
|
-
- app/mailer/tasks/mailer_task.rb
|
68
67
|
- lib/volt/mailer.rb
|
68
|
+
- lib/volt/mailer/mailer.rb
|
69
|
+
- lib/volt/mailer/mailer_task.rb
|
69
70
|
- lib/volt/mailer/version.rb
|
70
71
|
- volt-mailer.gemspec
|
71
72
|
homepage: ''
|