actionmailer_extensions 0.1.0 → 0.2.0
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.rdoc +39 -1
- data/VERSION +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
= actionmailer_extensions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
These extensions wrap around the "deliver!" method on ActionMailer::Base to provide:
|
|
4
|
+
* save all outgoing emails to disk, and
|
|
5
|
+
* a list of recipient email addresses that are safe to receive mail. All other mail is not sent.
|
|
6
|
+
|
|
7
|
+
== Saving email to disk
|
|
8
|
+
|
|
9
|
+
Sending email with markup from a web app is a pain in the ass because HTML markup renders differently in every
|
|
10
|
+
email client. (If you don't believe me, check out this {matrix of CSS support across the different email clients}[http://www.campaignmonitor.com/css/?utm_medium=email&utm_source=Email%20marketing%20software&utm_content=299578507&utm_campaign=September+News+-+Version+A+_+khihur&utm_term=AllnewCSSguidecovering24emailclients].
|
|
11
|
+
|
|
12
|
+
The only foolproof way to ensure that your content is rendering properly is to visually inspect the emails yourself. To get going, configure ActionMailer like so:
|
|
13
|
+
|
|
14
|
+
require 'actionmailer_extensions'
|
|
15
|
+
ActionMailer::Base.save_emails_to_disk = true # Defaults to false
|
|
16
|
+
ActionMailer::Base.email_output_dir = "some/path" # Defaults to "/tmp/actionmailer_output_emails"
|
|
17
|
+
|
|
18
|
+
Then send some emails with ActionMailer, and inspect the files in the output path that you specified. The emails are saved with a .eml extension which should open in your favourite email client for easy visual inspection.
|
|
19
|
+
|
|
20
|
+
== Safe recipients list
|
|
21
|
+
|
|
22
|
+
Ever found that you want to limit the list of people that can receive email from a Rails app? This is a particularly handy feature during development when you don't want your (unfinished) application to send out real mail to people beyond the dev team.
|
|
23
|
+
|
|
24
|
+
Configure ActionMailer like so:
|
|
25
|
+
|
|
26
|
+
require 'actionmailer_extensions'
|
|
27
|
+
ActionMailer::Base.safe_recipients = ["pete@example.com", "dave@foo.com"]
|
|
28
|
+
|
|
29
|
+
Pete and Dave are now the *only* recipients that ActionMailer will send to, and all other mail will be quietly dropped. (And logged to disk, if save_emails_to_disk is enabled.)
|
|
30
|
+
|
|
31
|
+
Make sure that the recipients list contains the :any symbol in production mode.
|
|
32
|
+
|
|
33
|
+
ActionMailer::Base.safe_recipients = [:any]
|
|
34
|
+
|
|
35
|
+
This is enabled by default. Also note that an empty or nil recipients list means no mail will be sent out to anyone.
|
|
36
|
+
|
|
37
|
+
== Install
|
|
38
|
+
|
|
39
|
+
gem source --add http://gemcutter.org
|
|
40
|
+
gem install actionmailer_extensions
|
|
41
|
+
|
|
4
42
|
|
|
5
43
|
== Note on Patches/Pull Requests
|
|
6
44
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.2.0
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: actionmailer_extensions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter MacRobert
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2010-02-
|
|
12
|
+
date: 2010-02-21 00:00:00 +00:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|