rails_email_preview 0.2.0 → 0.2.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 797865c605cdbc52c6d07762dde4375c903ac289
|
4
|
+
data.tar.gz: 13ea2b5e9817e420719b453752f9d0772c23f451
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebed3311bcf2ec7b7f1d6d9f24406df05955c4a3943593b5efe087f52d9d084f2e31e3a55a0a71b5a1b979e413af78803cdccc63fd13645bfa0cbfc2f7b9f62e
|
7
|
+
data.tar.gz: d8618319df290d7b6018e7679c45d682904a828bab4b594c2323295941df73b636af666ca2b577c081271a438e9a5c6a43e7bc388b2e4fe704991c5f1b5f9906
|
data/README.md
CHANGED
@@ -3,8 +3,9 @@ Rails Email Preview
|
|
3
3
|
|
4
4
|
A Rails Engine to preview plain text and html email in your browser. Compatible with Rails 3 and 4.
|
5
5
|
|
6
|
-
![screenshot]
|
7
|
-
![screenshot]
|
6
|
+
![screenshot][rep-show-screenshot]
|
7
|
+
![screenshot][rep-nav-screenshot]
|
8
|
+
|
8
9
|
*(styles are from the application)*
|
9
10
|
|
10
11
|
How to
|
@@ -68,7 +69,7 @@ Email editing
|
|
68
69
|
You can use [comfortable_mexican_sofa](https://github.com/comfy/comfortable-mexican-sofa) for storing and editing emails.
|
69
70
|
REP comes with an integration for it -- see [CMS Guide](https://github.com/glebm/rails_email_preview/wiki/Edit-Emails-with-Comfortable-Mexican-Sofa).
|
70
71
|
|
71
|
-
![
|
72
|
+
![screenshot][rep-edit-sofa-screenshot]
|
72
73
|
|
73
74
|
|
74
75
|
Premailer
|
@@ -88,6 +89,11 @@ REP expects emails to use current `I18n.locale`:
|
|
88
89
|
AccountMailer.some_notification.deliver
|
89
90
|
# different locale
|
90
91
|
I18n.with_locale('es') { InviteMailer.send_invites.deliver }
|
92
|
+
|
93
|
+
When linking to REP pages you can pass `email_locale` to set the locale for rendering:
|
94
|
+
|
95
|
+
# will render email in Spanish:
|
96
|
+
rails_email_preview.root_url(email_locale: 'es')
|
91
97
|
|
92
98
|
|
93
99
|
If you are using `Resque::Mailer` or `Devise::Async`, you can automatically add I18n.locale information when the mail job is scheduled
|
@@ -130,3 +136,7 @@ Alternatively, to have custom rules just for REP you can:
|
|
130
136
|
|
131
137
|
|
132
138
|
This project rocks and uses MIT-LICENSE.
|
139
|
+
|
140
|
+
[rep-nav-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-nav.png "Email List Screenshot"
|
141
|
+
[rep-show-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-show.png "Show Email Screenshot"
|
142
|
+
[rep-edit-sofa-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-edit-sofa.png "Edit Email with Comfortable Mexican Sofa Screenshot"
|
data/lib/rails_email_preview.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module RailsEmailPreview::MainAppRouteDelegator
|
2
2
|
# delegate url helpers to main_app
|
3
3
|
def method_missing(method, *args, &block)
|
4
|
-
if
|
4
|
+
if main_app_route_method?(method)
|
5
5
|
main_app.send(method, *args)
|
6
6
|
else
|
7
7
|
super
|
@@ -9,6 +9,11 @@ module RailsEmailPreview::MainAppRouteDelegator
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def respond_to?(method)
|
12
|
-
super ||
|
12
|
+
super || main_app_route_method?(method)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
def main_app_route_method?(method)
|
17
|
+
method.to_s =~ /_(?:path|url)$/ && main_app.respond_to?(method)
|
13
18
|
end
|
14
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_email_preview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gleb Mazovetskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -106,7 +106,6 @@ files:
|
|
106
106
|
- app/controllers/rails_email_preview/application_controller.rb
|
107
107
|
- app/controllers/rails_email_preview/emails_controller.rb
|
108
108
|
- app/helpers/rails_email_preview/emails_helper.rb
|
109
|
-
- app/helpers/rails_email_preview/rep_urls_helper.rb
|
110
109
|
- app/views/integrations/cms/_customize_cms_for_rails_email_preview.html.slim
|
111
110
|
- app/views/layouts/rails_email_preview/application.html.slim
|
112
111
|
- app/views/rails_email_preview/emails/_email_iframe.html.slim
|
@@ -1,10 +0,0 @@
|
|
1
|
-
module RepUrlsHelper
|
2
|
-
# to make it easy to change root url without breaking backwards compatibility, declare them here as aliases
|
3
|
-
def rep_root_url
|
4
|
-
rails_email_preview.rep_emails_url
|
5
|
-
end
|
6
|
-
|
7
|
-
def rep_root_path
|
8
|
-
rails_email_preview.rep_emails_path
|
9
|
-
end
|
10
|
-
end
|