mandrill_mailer 0.0.4 → 0.0.5
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.
data/README.md
CHANGED
@@ -25,13 +25,13 @@ Don't forget to setup your ENV variables on your server
|
|
25
25
|
You will also need to set default_url_options for the mailer, similar to action mailer
|
26
26
|
in your environment config files:
|
27
27
|
|
28
|
-
`MandrillMailer::
|
28
|
+
`MandrillMailer::Config.default_url_options = { :host => 'localhost' }`
|
29
29
|
|
30
30
|
## Creating a new mailer
|
31
31
|
Creating a new Mandrill Mailer is similar to a normal Rails mailer:
|
32
32
|
|
33
33
|
```
|
34
|
-
class InvitationMailer < MandrillMailer
|
34
|
+
class InvitationMailer < MandrillMailer::TransactionalMailer
|
35
35
|
default from: 'support@example.com'
|
36
36
|
|
37
37
|
def invite(invitation)
|
@@ -91,7 +91,7 @@ You can send the email by using the familiar syntax:
|
|
91
91
|
`InvitationMailer.invite(invitation).deliver`
|
92
92
|
|
93
93
|
## Creating a test method
|
94
|
-
When switching over to Mandrill for transactional emails we found that it was hard to setup a mailer in the console to send test emails easily (those darn designers), but really, you don't want to have to setup test objects everytime you want to send a test email. You can set up a testing '
|
94
|
+
When switching over to Mandrill for transactional emails we found that it was hard to setup a mailer in the console to send test emails easily (those darn designers), but really, you don't want to have to setup test objects everytime you want to send a test email. You can set up a testing 'mock' once and then call the `.test` method to send the test email.
|
95
95
|
|
96
96
|
You can test the above email by typing: `InvitationMailer.test(:invite, email:<your email>)` into the Rails Console.
|
97
97
|
|
@@ -125,10 +125,6 @@ module MandrillMailer
|
|
125
125
|
|
126
126
|
end
|
127
127
|
|
128
|
-
def default_url_options=(options={})
|
129
|
-
@@url_host = options[:host]
|
130
|
-
end
|
131
|
-
|
132
128
|
# Public: Triggers the stored Mandril params to be sent to the Mandrill api
|
133
129
|
#
|
134
130
|
# text - The String to be duplicated.
|
@@ -244,7 +240,7 @@ module MandrillMailer
|
|
244
240
|
end
|
245
241
|
end
|
246
242
|
else
|
247
|
-
Rails.application.routes.url_helpers.method(method).call(*args, host:
|
243
|
+
Rails.application.routes.url_helpers.method(method).call(*args, host: MandrillMailer::Config.default_url_options[:host])
|
248
244
|
end
|
249
245
|
end
|
250
246
|
|