mjml-rails 2.2.0 → 2.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d53faf3f214713c84ee67803ab0f39edff515e5
4
- data.tar.gz: fc01ca63c96f2cc3e5213954f6f84ae6bd80c47f
3
+ metadata.gz: 3d4ab2dd426acf0841f1db7464cc2c79c540f9a1
4
+ data.tar.gz: cd3fa2c7e97994e21e59a388335b6763fd735c7f
5
5
  SHA512:
6
- metadata.gz: 829127c28ea524654f5fc3be70b923571843f675339a97ad21cd5b6bd6b746ae218b581c097bac61cb09e2db417fe85dab32594f2a507040d4e4749024e7feb0
7
- data.tar.gz: 3bfd98687210b8185d6458ee40d578b4144414c0c33ebfcb616afff2944173c40bc7425e4800e9b23b0c10eee3461d591138be0ad54c46a55c7d1c12e024248a
6
+ metadata.gz: ea06266d0d46cb5f3abcb8ce6276b90edb6b09ae13f77a9c7c2b1849b41dd1b8428683b16d7622b3816e9cfcdc96d442154d5b3b6e7dbc27bb80d7f4e6118a45
7
+ data.tar.gz: 5b6a45bdf8563304a10be88520775a0bd7c2c4b373e19db3c7cf15685c2a7f15e7c747aef59169579e35326b10959b8be1d0a139f2a2564909c78c1da40505a0
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@^2.0
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": "^2.0"
130
+ "mjml": "^3.0"
102
131
  },
103
132
  "repository": {
104
133
  "type": "git",
@@ -8,7 +8,7 @@ module Mjml
8
8
 
9
9
  def self.check_version(bin)
10
10
  begin
11
- Gem::Dependency.new('','~> 2.0').match?('',`#{bin} --version`)
11
+ Gem::Dependency.new('','~> 3.0').match?('',`#{bin} --version`)
12
12
  rescue
13
13
  false
14
14
  end
@@ -1,4 +1,4 @@
1
1
  module Mjml
2
2
  # Version number matches MJML.io version
3
- VERSION = "2.2.0"
3
+ VERSION = "2.3.0"
4
4
  end
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.2.0
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-06-09 00:00:00.000000000 Z
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