mail-notify 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73b6476688422e8dc2ec90dbb6283b7a2cf6a1b292a2e2ce8df03f9ade76fa76
4
- data.tar.gz: df8844156e93c49667fe199f6f48541e7782e9962a0115988acd84ad6edd7628
3
+ metadata.gz: e91ec4d4b170c5fabeff04f13017e6c00f061db8fe4e7dd986c84b68ec2f91c9
4
+ data.tar.gz: 005c84b9497b0c8d5015544166ebe71cc198e9af8a94c01e3cabcbb3d14f6479
5
5
  SHA512:
6
- metadata.gz: c8e6ace1774b896aa6f7b6be2653039da301853c2d8a7381b77abe4cfdd4f0ef6147adbab7d7c32bbba68071d5065ee470f67972b286dbe58e7498f35dda50fa
7
- data.tar.gz: d4fdf9308a1610611270403cc285358b377390f0de99bd769ba0a879df2cad9220ecb4e7096792e6d4913d1c3d2752d02c88f2f5a1207984ba3e8cd0ad5f55ee
6
+ metadata.gz: 278189dc0d7490eda9f64f894a2a098fad226a48123414bf829e7d0ef45f4b00b77d082d9f74889163af402efd21192bef585d74fbae15d1e8484033a604c62b
7
+ data.tar.gz: 7deb6fa252d4955216f604664de081a3a1b2729eefc11ff58f51d6821706427dc90520a896eb30de987f9d8299b460449562656bc1ad77c5462cc2235ca2f4ea
@@ -1,6 +1,6 @@
1
- name: Ruby
1
+ name: Build
2
2
 
3
- on: [push]
3
+ on: [push, pull_request]
4
4
 
5
5
  jobs:
6
6
  build:
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog]
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.1] - 2019-10-22
10
+
11
+ - Add Rails 6 support for previews
12
+ - Add GOV.UK Notify styling to preview emails
13
+
9
14
  ## [0.2.0] - 2019-08-30
10
15
 
11
16
  - Add Rails 6 support
@@ -30,6 +35,7 @@ The format is based on [Keep a Changelog]
30
35
 
31
36
  [unreleased]:
32
37
  https://github.com/DFE-Digital/dfe-teachers-payment-service/compare/0.1.0...HEAD
38
+ [0.2.1]: https://github.com/dxw/mail-notify/compare/0.2.0...0.2.1
33
39
  [0.2.0]: https://github.com/dxw/mail-notify/compare/0.1.0...0.2.0
34
40
  [0.1.0]: https://github.com/dxw/mail-notify/compare/0.0.3...0.1.0
35
41
  [0.0.3]: https://github.com/dxw/mail-notify/compare/0.0.2...0.0.3
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![CircleCI Status](https://img.shields.io/circleci/build/gh/dxw/mail-notify.svg?style=flat-square)](https://circleci.com/gh/dxw/mail-notify)
1
+ [![Build Status](https://github.com/dxw/mail-notify/workflows/Build/badge.svg)](https://github.com/dxw/mail-notify/actions)
2
2
  [![Coverage Status](https://img.shields.io/coveralls/github/pezholio/mail-notify.svg?style=flat-square)](https://coveralls.io/github/pezholio/mail-notify)
3
3
  [![Gem Version](http://img.shields.io/gem/v/mail-notify.svg?style=flat-square)](https://rubygems.org/gems/mail-notify)
4
4
  [![License](http://img.shields.io/:license-mit-blue.svg)](https://mit-license.org/)
data/Rakefile CHANGED
@@ -3,9 +3,11 @@
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
5
  require 'rubocop/rake_task'
6
+ require 'coveralls/rake/task'
6
7
 
8
+ Coveralls::RakeTask.new
7
9
  RuboCop::RakeTask.new
8
10
 
9
11
  RSpec::Core::RakeTask.new(:spec)
10
12
 
11
- task default: %i[rubocop spec]
13
+ task default: %i[rubocop spec coveralls:push]
@@ -0,0 +1,153 @@
1
+ <%# Copied from GOV.UK Notify: https://raw.githubusercontent.com/alphagov/notifications-utils/d69de041d1be7b826e7d9cc56450e157ad361799/notifications_utils/jinja_templates/email_template.jinja2 %>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
+ <meta content="telephone=no" name="format-detection" /> <!-- need to add formatting for real phone numbers -->
8
+ <meta name="viewport" content="width=device-width" />
9
+ <title>Page title</title>
10
+
11
+ <style type="text/css">
12
+ @media only screen and (min-device-width: 581px) {
13
+ .content {
14
+ width: 580px !important;
15
+ }
16
+ }
17
+ body { margin:0 !important; }
18
+ div[style*="margin: 16px 0"] { margin:0 !important; }
19
+ </style>
20
+
21
+ <!--[if gte mso 9]>
22
+ <style type="text/css">
23
+ li {
24
+ margin-left: 4px !important;
25
+ }
26
+ table {
27
+ mso-table-lspace: 0pt;
28
+ mso-table-rspace: 0pt;
29
+ }
30
+ </style>
31
+ <![endif]-->
32
+
33
+ </head>
34
+
35
+ <body style="font-family: Helvetica, Arial, sans-serif;font-size: 16px;margin: 0;color:#0b0c0c;">
36
+
37
+ <span style="display: none;font-size: 1px;color: #fff; max-height: 0;"></span>
38
+ <table role="presentation" width="100%" style="border-collapse: collapse;min-width: 100%;width: 100% !important;" cellpadding="0" cellspacing="0" border="0">
39
+ <tr>
40
+ <td width="100%" height="53" bgcolor="#0b0c0c">
41
+ <!--[if (gte mso 9)|(IE)]>
42
+ <table role="presentation" width="580" align="center" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse;width: 580px;">
43
+ <tr>
44
+ <td>
45
+ <![endif]-->
46
+ <table role="presentation" width="100%" style="border-collapse: collapse;max-width: 580px;" cellpadding="0" cellspacing="0" border="0" align="center">
47
+ <tr>
48
+ <td width="70" bgcolor="#0b0c0c" valign="middle">
49
+ <a href="https://www.gov.uk" title="Go to the GOV.UK homepage" style="text-decoration: none;">
50
+ <table role="presentation" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse;">
51
+ <tr>
52
+ <td style="padding-left: 10px">
53
+ <img
54
+ src="https://static.notifications.service.gov.uk/images/gov.uk_logotype_crown.png"
55
+ alt=" "
56
+ height="32"
57
+ border="0"
58
+ style="Margin-top: 4px;"
59
+ />
60
+ </td>
61
+ <td style="font-size: 28px; line-height: 1.315789474; Margin-top: 4px; padding-left: 10px;">
62
+ <span style="
63
+ font-family: Helvetica, Arial, sans-serif;
64
+ font-weight: 700;
65
+ color: #ffffff;
66
+ text-decoration: none;
67
+ vertical-align:top;
68
+ display: inline-block;
69
+ ">GOV.UK</span>
70
+ </td>
71
+ </tr>
72
+ </table>
73
+ </a>
74
+ </td>
75
+ </tr>
76
+ </table>
77
+ <!--[if (gte mso 9)|(IE)]>
78
+ </td>
79
+ </tr>
80
+ </table>
81
+ <![endif]-->
82
+ </td>
83
+ </tr>
84
+ </table>
85
+ <table
86
+ role="presentation"
87
+ class="content"
88
+ align="center"
89
+ cellpadding="0"
90
+ cellspacing="0"
91
+ border="0"
92
+ style="border-collapse: collapse;max-width: 580px; width: 100% !important;"
93
+ width="100%"
94
+ >
95
+ <tr>
96
+ <td width="10" height="10" valign="middle"></td>
97
+ <td>
98
+ <!--[if (gte mso 9)|(IE)]>
99
+ <table role="presentation" width="560" align="center" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse;width: 560px;">
100
+ <tr>
101
+ <td height="10">
102
+ <![endif]-->
103
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse;">
104
+ <tr>
105
+ <td bgcolor="#005EA5" width="100%" height="10"></td>
106
+ </tr>
107
+ </table>
108
+ <!--[if (gte mso 9)|(IE)]>
109
+ </td>
110
+ </tr>
111
+ </table>
112
+ <![endif]-->
113
+ </td>
114
+ <td width="10" valign="middle" height="10"></td>
115
+ </tr>
116
+ </table>
117
+
118
+ <table
119
+ role="presentation"
120
+ class="content"
121
+ align="center"
122
+ cellpadding="0"
123
+ cellspacing="0"
124
+ border="0"
125
+ style="border-collapse: collapse;max-width: 580px; width: 100% !important;"
126
+ width="100%"
127
+ >
128
+ <tr>
129
+ <td height="30"><br /></td>
130
+ </tr>
131
+ <tr>
132
+ <td width="10" valign="middle"><br /></td>
133
+ <td style="font-family: Helvetica, Arial, sans-serif; font-size: 19px; line-height: 1.315789474; max-width: 560px;">
134
+ <!--[if (gte mso 9)|(IE)]>
135
+ <table role="presentation" width="560" align="center" cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse;width: 560px;">
136
+ <tr>
137
+ <td style="font-family: Helvetica, Arial, sans-serif; font-size: 19px; line-height: 1.315789474;">
138
+ <![endif]-->
139
+ <%= yield %>
140
+ <!--[if (gte mso 9)|(IE)]>
141
+ </td>
142
+ </tr>
143
+ </table>
144
+ <![endif]-->
145
+ </td>
146
+ <td width="10" valign="middle"><br /></td>
147
+ </tr>
148
+ <tr>
149
+ <td height="30"><br /></td>
150
+ </tr>
151
+ </table>
152
+ </body>
153
+ </html>
@@ -19,13 +19,17 @@ module Mail
19
19
  private
20
20
 
21
21
  def render_part
22
+ # Add the current directory to the view path so that Rails can find
23
+ # the `govuk_notify_layout` layout
24
+ append_view_path(__dir__)
25
+
22
26
  response.content_type = 'text/html'
23
- render plain: @email.preview.html.html_safe
27
+ render html: @email.preview.html.html_safe, layout: 'govuk_notify_layout'
24
28
  end
25
29
 
26
30
  def render_preview_wrapper
27
31
  @part = @email
28
- render action: 'email', layout: false, formats: %w[html]
32
+ render action: 'email', layout: false, formats: %i[html]
29
33
  end
30
34
 
31
35
  def notify?
@@ -9,7 +9,7 @@ module Mail
9
9
 
10
10
  initializer 'mail-notify.action_controller' do
11
11
  ActiveSupport.on_load(:action_controller, run_once: true) do
12
- Rails::MailersController.send(:prepend, Mail::Notify::MailersController)
12
+ Rails::MailersController.prepend(Mail::Notify::MailersController)
13
13
  end
14
14
  end
15
15
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Mail
4
4
  module Notify
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'bundler', '~> 2.0'
27
27
  spec.add_development_dependency 'coveralls', '~> 0.8.22'
28
28
  spec.add_development_dependency 'pry', '~> 0.12.0'
29
- spec.add_development_dependency 'rails', '~> 5.2'
29
+ spec.add_development_dependency 'rails', '~> 6.0'
30
30
  spec.add_development_dependency 'rake', '~> 10.0'
31
31
  spec.add_development_dependency 'rspec-rails', '~> 3.8'
32
32
  spec.add_development_dependency 'rubocop', '~> 0.63'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mail-notify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Harrison
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-30 00:00:00.000000000 Z
11
+ date: 2019-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '5.2'
61
+ version: '6.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '5.2'
68
+ version: '6.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -165,8 +165,8 @@ extra_rdoc_files: []
165
165
  files:
166
166
  - ".coveralls.yml"
167
167
  - ".github/setup-rubygems.sh"
168
+ - ".github/workflows/build.yml"
168
169
  - ".github/workflows/publish.yml"
169
- - ".github/workflows/ruby.yml"
170
170
  - ".gitignore"
171
171
  - ".rspec"
172
172
  - ".rubocop.yml"
@@ -183,6 +183,7 @@ files:
183
183
  - docs/screenshot.png
184
184
  - lib/mail/notify.rb
185
185
  - lib/mail/notify/delivery_method.rb
186
+ - lib/mail/notify/layouts/govuk_notify_layout.html.erb
186
187
  - lib/mail/notify/mailer.rb
187
188
  - lib/mail/notify/mailers_controller.rb
188
189
  - lib/mail/notify/message.rb