From b16b1929b49c9c25fff24e800c1a45cba11f21af Mon Sep 17 00:00:00 2001 From: "Manny.Muriel" Date: Thu, 11 Aug 2016 14:30:57 -0700 Subject: [PATCH] Rails Email Config --- Gemfile | 4 +++ Gemfile.lock | 15 ++++++++ app/assets/stylesheets/foundation_emails.scss | 9 +++++ .../{reminder.html.erb => reminder.html.inky} | 35 ++++++------------- app/views/layouts/application.html.erb | 1 + app/views/layouts/mailer.html.erb | 20 +++++++---- .../layouts/old_mailer_1470948990.html.erb | 13 +++++++ config/initializers/assets.rb | 2 +- 8 files changed, 68 insertions(+), 31 deletions(-) create mode 100644 app/assets/stylesheets/foundation_emails.scss rename app/views/candidate_mailer/{reminder.html.erb => reminder.html.inky} (51%) create mode 100644 app/views/layouts/old_mailer_1470948990.html.erb diff --git a/Gemfile b/Gemfile index 651faee..667035c 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,10 @@ gem 'uglifier', '>= 1.3.0' gem 'bourbon' gem 'neat' +# Foundation for Emails +gem 'inky-rb', require: 'inky' +gem 'premailer-rails' + group :development do gem 'better_errors' gem 'rack-livereload' diff --git a/Gemfile.lock b/Gemfile.lock index a704484..31a7bcb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,6 +38,7 @@ GEM i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) + addressable (2.4.0) ansi (1.5.0) arel (7.1.0) ast (2.3.0) @@ -57,6 +58,8 @@ GEM choice (0.2.0) coderay (1.1.1) concurrent-ruby (1.0.2) + css_parser (1.4.5) + addressable debug_inspector (0.0.2) docile (1.1.5) domain_name (0.5.20160615) @@ -71,6 +74,7 @@ GEM figaro (1.1.1) thor (~> 0.14) formatador (0.2.5) + foundation_emails (2.2.0.0) globalid (0.3.6) activesupport (>= 4.1.0) guard (2.14.0) @@ -97,10 +101,13 @@ GEM guard-shell (0.7.1) guard (>= 2.0.0) guard-compat (~> 1.0) + htmlentities (4.3.4) http-cookie (1.0.2) domain_name (~> 0.5) http_parser.rb (0.6.0) i18n (0.7.0) + inky-rb (1.3.6.1) + foundation_emails (~> 2) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) multi_json (~> 1.2) @@ -151,6 +158,12 @@ GEM ast (~> 2.2) pkg-config (1.1.7) powerpack (0.1.1) + premailer (1.8.7) + css_parser (>= 1.4.5) + htmlentities (>= 4.0.0) + premailer-rails (1.9.4) + actionmailer (>= 3, < 6) + premailer (~> 1.7, >= 1.7.9) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -281,6 +294,7 @@ DEPENDENCIES guard-minitest guard-rubocop guard-shell + inky-rb jbuilder (~> 2.6) jquery-rails json (~> 2.0.2) @@ -289,6 +303,7 @@ DEPENDENCIES minitest-reporters mysql2 (>= 0.3.18, < 0.5) neat + premailer-rails pry-byebug pry-rails puma (~> 3.0) diff --git a/app/assets/stylesheets/foundation_emails.scss b/app/assets/stylesheets/foundation_emails.scss new file mode 100644 index 0000000..1646a71 --- /dev/null +++ b/app/assets/stylesheets/foundation_emails.scss @@ -0,0 +1,9 @@ +@import "foundation-emails"; +.pd-logo { + font-size: 28px; +} + +.email-container { + width: 100% !important; + max-width:600px; +} \ No newline at end of file diff --git a/app/views/candidate_mailer/reminder.html.erb b/app/views/candidate_mailer/reminder.html.inky similarity index 51% rename from app/views/candidate_mailer/reminder.html.erb rename to app/views/candidate_mailer/reminder.html.inky index af7393c..4c447c7 100644 --- a/app/views/candidate_mailer/reminder.html.erb +++ b/app/views/candidate_mailer/reminder.html.inky @@ -1,16 +1,12 @@ - - + + + + + - - - - - - - - - - - - -
-
PERFICIENT/digital Skills Assessment Test
-


-
-

Dear <%= @candidate.name %>,

+ + +

Dear <%= @candidate.name %>,

Thank you for taking the Skills Assessment Test. However, it looks like you have not submitted it yet. If you are having trouble, please reach out to your recruiter: @@ -19,18 +15,9 @@

You can return to the test here: <%= link_to nil, root_url %>. -
+
Your Test ID is: <%= @candidate.test_hash %>

-
-


-


 
-
+ + \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9e37c00..1dd9704 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,5 +1,6 @@ + diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index ab4308c..374751e 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,13 +1,21 @@ - - + + - + + + <%= stylesheet_link_tag "foundation_emails" %> - <%= yield %> + + + + +
+
+ <%= yield %> +
+
diff --git a/app/views/layouts/old_mailer_1470948990.html.erb b/app/views/layouts/old_mailer_1470948990.html.erb new file mode 100644 index 0000000..ab4308c --- /dev/null +++ b/app/views/layouts/old_mailer_1470948990.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 3ef4dab..d7d0686 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -11,5 +11,5 @@ Rails.application.config.assets.version = '1.0' # Rails.application.config.assets.precompile += %w( search.js ) Rails.application.config.assets.precompile += ['vendor/assets/**/*'] - Rails.application.config.assets.precompile += %w(ie9.js) +Rails.application.config.assets.precompile += %w( foundation_emails.css )