mjml-rails 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +31 -2
- data/lib/mjml.rb +1 -1
- data/lib/mjml/version.rb +1 -1
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d4ab2dd426acf0841f1db7464cc2c79c540f9a1
|
4
|
+
data.tar.gz: cd3fa2c7e97994e21e59a388335b6763fd735c7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea06266d0d46cb5f3abcb8ce6276b90edb6b09ae13f77a9c7c2b1849b41dd1b8428683b16d7622b3816e9cfcdc96d442154d5b3b6e7dbc27bb80d7f4e6118a45
|
7
|
+
data.tar.gz: 5b6a45bdf8563304a10be88520775a0bd7c2c4b373e19db3c7cf15685c2a7f15e7c747aef59169579e35326b10959b8be1d0a139f2a2564909c78c1da40505a0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -62,13 +62,42 @@ bundle install
|
|
62
62
|
Install the MJML parser (optional -g to install it globally):
|
63
63
|
|
64
64
|
```console
|
65
|
-
npm install -g mjml@^
|
65
|
+
npm install -g mjml@^3.0
|
66
66
|
```
|
67
67
|
|
68
68
|
### How to guides
|
69
69
|
|
70
70
|
[Hugo Giraudel](https://twitter.com/hugogiraudel) wrote a post on [using MJML in Rails](http://dev.edenspiekermann.com/2016/06/02/using-mjml-in-rails/).
|
71
71
|
|
72
|
+
## Sending Devise user emails
|
73
|
+
|
74
|
+
If you use [Devise](https://github.com/plataformatec/devise) for user authentication and want to send user emails with MJML templates, here's how to override the [devise mailer](https://github.com/plataformatec/devise/blob/master/app/mailers/devise/mailer.rb):
|
75
|
+
```ruby
|
76
|
+
# app/mailers/devise_mailer.rb
|
77
|
+
class DeviseMailer < Devise::Mailer
|
78
|
+
def reset_password_instructions(record, token, opts={})
|
79
|
+
@token = token
|
80
|
+
@resource = record
|
81
|
+
# Custom logic to send the email with MJML
|
82
|
+
mail(
|
83
|
+
template_path: 'devise/mailer',
|
84
|
+
from: "some@email.com",
|
85
|
+
to: record.email,
|
86
|
+
subject: "Custom subject"
|
87
|
+
) do |format|
|
88
|
+
format.mjml
|
89
|
+
format.text
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
```
|
94
|
+
|
95
|
+
Now tell devise to user your mailer in `config/initializers/devise.rb` by setting `config.mailer = 'DeviseMailer'` or whatever name you called yours.
|
96
|
+
|
97
|
+
And then your MJML template goes here: `app/views/devise/mailer/reset_password_instructions.mjml`
|
98
|
+
|
99
|
+
Devise also have [more instructions](https://github.com/plataformatec/devise/wiki/How-To:-Use-custom-mailer) if you need them.
|
100
|
+
|
72
101
|
## Deploying with Heroku
|
73
102
|
|
74
103
|
To deploy with [Heroku](https://heroku.com) you'll need to setup [multiple buildpacks](https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app) so that Heroku first builds Node for MJML and then the Ruby environment for your app.
|
@@ -98,7 +127,7 @@ Next you'll need to setup a `package.json` file in the root, something like this
|
|
98
127
|
"test": "test"
|
99
128
|
},
|
100
129
|
"dependencies": {
|
101
|
-
"mjml": "^
|
130
|
+
"mjml": "^3.0"
|
102
131
|
},
|
103
132
|
"repository": {
|
104
133
|
"type": "git",
|
data/lib/mjml.rb
CHANGED
data/lib/mjml/version.rb
CHANGED
metadata
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mjml-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Loffler
|
8
|
+
- Steven Pickles
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain:
|
@@ -30,7 +31,7 @@ cert_chain:
|
|
30
31
|
5hPZOkUdP3egZ1xAHeFIOhTIaOJezjUEDQVattPkgwl25+Q2EXJ+5ehDU86v+lxH
|
31
32
|
E9hMwkxwQntg0fKVFbnVMOg2itaj8fJ7
|
32
33
|
-----END CERTIFICATE-----
|
33
|
-
date: 2016-
|
34
|
+
date: 2016-10-22 00:00:00.000000000 Z
|
34
35
|
dependencies: []
|
35
36
|
description: Render MJML + ERb template views in Rails
|
36
37
|
email: sighmon@sighmon.com
|
metadata.gz.sig
CHANGED
Binary file
|