mjml-rails 2.1.1 → 2.1.4
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/MIT-LICENSE +4 -0
- data/README.md +68 -3
- data/lib/mjml/version.rb +1 -1
- data.tar.gz.sig +3 -1
- metadata +2 -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: bf6eef06d74f2371d4fb2ea04df243440ad47df6
|
4
|
+
data.tar.gz: 11a9f4de6b6e6bcc161578da22243fc5fe11e364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0549178dd254f105866c35dce89506efdc72d249275c780e1961fc196f6ce2ea617b270885bfe661db206a1447336d22168b4c7a35acd74d94c15a7d0010e39d
|
7
|
+
data.tar.gz: 948508e87b46bf9732ae8aedf07e285cdbcf9cb1fb85b39a21b9fa7763c99f5caf75ad0127192803c61e1fa447cf7eca30d978256f2df28a19e71a2711da94ff
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
# MJML-Rails
|
2
2
|
|
3
|
-
[![Build Status](https://api.travis-ci.org/sighmon/mjml-rails.
|
3
|
+
[![Build Status](https://api.travis-ci.org/sighmon/mjml-rails.svg?branch=master)](http://travis-ci.org/sighmon/mjml-rails) [![Gem Version](https://badge.fury.io/rb/mjml-rails.svg)](https://badge.fury.io/rb/mjml-rails)
|
4
4
|
|
5
5
|
**MJML-Rails** allows you to render HTML e-mails from an [MJML](https://mjml.io) template.
|
6
6
|
|
7
|
-
An example template might look like
|
7
|
+
An example template might look like:
|
8
8
|
|
9
9
|
```erb
|
10
|
+
<!-- ./app/views/user_mailer/email.mjml -->
|
10
11
|
<mjml>
|
11
12
|
<mj-body>
|
12
13
|
<mj-container>
|
@@ -24,11 +25,26 @@ An example template might look like `app/views/user_mailer/email.mjml`:
|
|
24
25
|
And the partial `_info.mjml`:
|
25
26
|
|
26
27
|
```erb
|
28
|
+
<!-- ./app/views/user_mailer/_info.mjml -->
|
27
29
|
<mj-text>This is <%= @user.username %></mj-text>
|
28
30
|
```
|
29
31
|
|
30
32
|
* Notice you can use ERb and partials inside the template.
|
31
33
|
|
34
|
+
Your `user_mailer.rb` might look like this::
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
# ./app/mailers/user_mailer.rb
|
38
|
+
class UserMailer < ActionMailer::Base
|
39
|
+
def user_signup_confirmation()
|
40
|
+
mail(to: 'test@example.com', subject: 'test') do |format|
|
41
|
+
format.text
|
42
|
+
format.mjml
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
```
|
47
|
+
|
32
48
|
## Installation
|
33
49
|
|
34
50
|
Add it to your Gemfile.
|
@@ -46,9 +62,58 @@ bundle install
|
|
46
62
|
Install the MJML parser
|
47
63
|
|
48
64
|
```console
|
49
|
-
npm install -g mjml@2.1.
|
65
|
+
npm install -g mjml@2.1.4
|
50
66
|
```
|
51
67
|
|
68
|
+
## Deploying with Heroku
|
69
|
+
|
70
|
+
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.
|
71
|
+
|
72
|
+
Once you've installed the [Heroku Toolbelt](https://toolbelt.heroku.com/) you can setup the buildpacks from the commandline:
|
73
|
+
|
74
|
+
`$ heroku buildpacks:set heroku/ruby`
|
75
|
+
|
76
|
+
And then add the Node buildpack to index 1 so it's run first:
|
77
|
+
|
78
|
+
`$ heroku buildpacks:add --index 1 heroku/nodejs`
|
79
|
+
|
80
|
+
Check that's all setup by running:
|
81
|
+
|
82
|
+
`$ heroku buildpacks`
|
83
|
+
|
84
|
+
Next you'll need to setup a `package.json` file in the root, something like this:
|
85
|
+
|
86
|
+
```json
|
87
|
+
{
|
88
|
+
"name": "your-site",
|
89
|
+
"version": "1.0.0",
|
90
|
+
"description": "Now with MJML email templates!",
|
91
|
+
"main": "index.js",
|
92
|
+
"directories": {
|
93
|
+
"doc": "doc",
|
94
|
+
"test": "test"
|
95
|
+
},
|
96
|
+
"dependencies": {
|
97
|
+
"mjml": "2.1.4"
|
98
|
+
},
|
99
|
+
"repository": {
|
100
|
+
"type": "git",
|
101
|
+
"url": "git+https://github.com/your-repo/your-site.git"
|
102
|
+
},
|
103
|
+
"keywords": [
|
104
|
+
"mailer"
|
105
|
+
],
|
106
|
+
"author": "Your Name",
|
107
|
+
"license": "ISC",
|
108
|
+
"bugs": {
|
109
|
+
"url": "https://github.com/sighmon/mjml-rails/issues"
|
110
|
+
},
|
111
|
+
"homepage": "https://github.com/sighmon/mjml-rails"
|
112
|
+
}
|
113
|
+
```
|
114
|
+
|
115
|
+
Then `$ git push heroku master` and it should Just WorkTM.
|
116
|
+
|
52
117
|
## Bug reports
|
53
118
|
|
54
119
|
If you discover any bugs, feel free to create an issue on GitHub. Please add as much information as possible to help us fixing the possible bug. We also encourage you to help even more by forking and sending us a pull request.
|
data/lib/mjml/version.rb
CHANGED
data.tar.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
|
1
|
+
��B��M���<��I�0 q���y��?a�+] 4��U$�8Ygg���`���s�Nt=sX=�«��܀<��3�ȫ��fk�Y&ɿղ�������B���K�~������$ϵTf�L�6��H�]�ҭ
|
2
|
+
��
|
3
|
+
~(_ �1�{�9C�����ʾ�L�4�����t%�<b�ֹ��!F��-ҰE``c���`2Wo���Ez���s��
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mjml-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Simon Loffler
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
5hPZOkUdP3egZ1xAHeFIOhTIaOJezjUEDQVattPkgwl25+Q2EXJ+5ehDU86v+lxH
|
31
31
|
E9hMwkxwQntg0fKVFbnVMOg2itaj8fJ7
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2016-
|
33
|
+
date: 2016-06-02 00:00:00.000000000 Z
|
34
34
|
dependencies: []
|
35
35
|
description: Render MJML + ERb template views in Rails
|
36
36
|
email: sighmon@sighmon.com
|
metadata.gz.sig
CHANGED
Binary file
|