From 56db2686130c753c6ac714112b9715fddf0008dd Mon Sep 17 00:00:00 2001 From: Steven Hancock Date: Sat, 28 Apr 2012 04:00:56 -0700 Subject: [PATCH] Use markerb for emails * Add markerb to the Gemfile * Update mailer classes to send multipart text+html emails * Simplify all email templates and convert to Markdown+ERB This required stripping the CSS and images from the emails. All Markdown templates are based on the original HTML version except for the inviter, where it was much easier to work with the text version (and the i18n contains the whole message anyway). --- Gemfile | 7 +- Gemfile.lock | 3 + app/mailers/notifier.rb | 15 +- app/views/devise/mailer/_inviter.erb | 18 -- .../mailer/confirmation_instructions.haml | 13 -- .../mailer/confirmation_instructions.markerb | 7 + .../devise/mailer/invitation_instructions.erb | 174 ------------------ .../mailer/invitation_instructions.markerb} | 0 .../mailer/reset_password_instructions.haml | 15 -- .../reset_password_instructions.markerb | 11 ++ .../devise/mailer/unlock_instructions.haml | 14 -- .../devise/mailer/unlock_instructions.markerb | 9 + app/views/notifier/also_commented.html.haml | 4 - app/views/notifier/also_commented.markerb | 5 + app/views/notifier/also_commented.text.haml | 1 - app/views/notifier/comment_on_post.html.haml | 4 - app/views/notifier/comment_on_post.markerb | 5 + app/views/notifier/comment_on_post.text.haml | 1 - app/views/notifier/confirm_email.html.haml | 7 - app/views/notifier/confirm_email.markerb | 5 + app/views/notifier/confirm_email.text.haml | 4 - app/views/notifier/invite.html.erb | 134 -------------- app/views/notifier/invite.markerb | 1 + app/views/notifier/liked.html.haml | 8 - app/views/notifier/liked.markerb | 7 + app/views/notifier/liked.text.haml | 3 - app/views/notifier/mentioned.html.haml | 4 - app/views/notifier/mentioned.markerb | 5 + app/views/notifier/mentioned.text.haml | 1 - app/views/notifier/private_message.html.haml | 4 - app/views/notifier/private_message.markerb | 5 + app/views/notifier/private_message.text.haml | 1 - app/views/notifier/reshared.html.haml | 8 - app/views/notifier/reshared.markerb | 7 + app/views/notifier/reshared.text.haml | 3 - app/views/notifier/single_admin.html.haml | 8 - app/views/notifier/single_admin.markerb | 7 + app/views/notifier/single_admin.text.haml | 6 - app/views/notifier/started_sharing.html.haml | 5 - app/views/notifier/started_sharing.markerb | 5 + app/views/notifier/started_sharing.text.haml | 4 - 41 files changed, 98 insertions(+), 450 deletions(-) delete mode 100644 app/views/devise/mailer/_inviter.erb delete mode 100644 app/views/devise/mailer/confirmation_instructions.haml create mode 100644 app/views/devise/mailer/confirmation_instructions.markerb delete mode 100644 app/views/devise/mailer/invitation_instructions.erb rename app/views/{notifier/invite.text.erb => devise/mailer/invitation_instructions.markerb} (100%) delete mode 100644 app/views/devise/mailer/reset_password_instructions.haml create mode 100644 app/views/devise/mailer/reset_password_instructions.markerb delete mode 100644 app/views/devise/mailer/unlock_instructions.haml create mode 100644 app/views/devise/mailer/unlock_instructions.markerb delete mode 100644 app/views/notifier/also_commented.html.haml create mode 100644 app/views/notifier/also_commented.markerb delete mode 100644 app/views/notifier/also_commented.text.haml delete mode 100644 app/views/notifier/comment_on_post.html.haml create mode 100644 app/views/notifier/comment_on_post.markerb delete mode 100644 app/views/notifier/comment_on_post.text.haml delete mode 100644 app/views/notifier/confirm_email.html.haml create mode 100644 app/views/notifier/confirm_email.markerb delete mode 100644 app/views/notifier/confirm_email.text.haml delete mode 100644 app/views/notifier/invite.html.erb create mode 100644 app/views/notifier/invite.markerb delete mode 100644 app/views/notifier/liked.html.haml create mode 100644 app/views/notifier/liked.markerb delete mode 100644 app/views/notifier/liked.text.haml delete mode 100644 app/views/notifier/mentioned.html.haml create mode 100644 app/views/notifier/mentioned.markerb delete mode 100644 app/views/notifier/mentioned.text.haml delete mode 100644 app/views/notifier/private_message.html.haml create mode 100644 app/views/notifier/private_message.markerb delete mode 100644 app/views/notifier/private_message.text.haml delete mode 100644 app/views/notifier/reshared.html.haml create mode 100644 app/views/notifier/reshared.markerb delete mode 100644 app/views/notifier/reshared.text.haml delete mode 100644 app/views/notifier/single_admin.html.haml create mode 100644 app/views/notifier/single_admin.markerb delete mode 100644 app/views/notifier/single_admin.text.haml delete mode 100644 app/views/notifier/started_sharing.html.haml create mode 100644 app/views/notifier/started_sharing.markerb delete mode 100644 app/views/notifier/started_sharing.text.haml diff --git a/Gemfile b/Gemfile index 72ef5751f..39033d4a4 100644 --- a/Gemfile +++ b/Gemfile @@ -29,6 +29,7 @@ gem 'rails_admin' # mail +gem 'markerb', '~> 1.0.0' gem 'messagebus_ruby_api', '1.0.3' gem 'airbrake' gem 'newrelic_rpm' @@ -116,12 +117,12 @@ group :assets do # install Node.js or use 'therubyracer'. # # See https://github.com/sstephenson/execjs#readme for more supported runtimes - + # gem 'therubyracer', :platform => :ruby - + gem 'handlebars_assets' gem 'uglifier' - + # asset_sync is required as needed by application.rb gem "asset_sync", :require => nil end diff --git a/Gemfile.lock b/Gemfile.lock index 0ca09738f..0c97f70f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,6 +263,8 @@ GEM i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) + markerb (1.0.0) + redcarpet (>= 2.0) messagebus_ruby_api (1.0.3) mime-types (1.18) mini_magick (3.4) @@ -543,6 +545,7 @@ DEPENDENCIES json jwt linecache (= 0.46) + markerb (~> 1.0.0) messagebus_ruby_api (= 1.0.3) mini_magick (= 3.4) mobile-fu diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 834bb6ec5..d16b46df6 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -30,7 +30,10 @@ class Notifier < ActionMailer::Base - mail(default_opts) + mail(default_opts) do |format| + format.text + format.html + end end def invite(email, message, inviter, invitation_code, locale) @@ -44,7 +47,10 @@ class Notifier < ActionMailer::Base :host => AppConfig[:pod_uri].host} I18n.with_locale(locale) do - mail(mail_opts) + mail(mail_opts) do |format| + forat.text + forat.html + end end end @@ -85,7 +91,10 @@ class Notifier < ActionMailer::Base @notification = NotificationMailers.const_get(type.to_s.camelize).new(*args) with_recipient_locale do - mail(@notification.headers) + mail(@notification.headers) do |format| + format.text + format.html + end end end diff --git a/app/views/devise/mailer/_inviter.erb b/app/views/devise/mailer/_inviter.erb deleted file mode 100644 index cc058942b..000000000 --- a/app/views/devise/mailer/_inviter.erb +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - -
- - - <%= t('.has_invited_you', :name => invite.sender.name + " (#{invite.sender.diaspora_handle})") %>
- - <% unless invite.message.blank? %> - "<%= invite.message %>" - <% end %> - -
- diff --git a/app/views/devise/mailer/confirmation_instructions.haml b/app/views/devise/mailer/confirmation_instructions.haml deleted file mode 100644 index fb7b88775..000000000 --- a/app/views/devise/mailer/confirmation_instructions.haml +++ /dev/null @@ -1,13 +0,0 @@ -!!! -%html - %head - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - = render :partial => 'notifier/notifier_css' - %body - %header - = image_tag('branding/white.png') - #container - %p - = t('devise.mailer.welcome', :email => @resource.email) - %p= t('.you_can_confirm') - %p= link_to t('.confirm'), confirmation_url(@resource, :confirmation_token => @resource.confirmation_token), :class => "large_text" diff --git a/app/views/devise/mailer/confirmation_instructions.markerb b/app/views/devise/mailer/confirmation_instructions.markerb new file mode 100644 index 000000000..987654218 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.markerb @@ -0,0 +1,7 @@ +<%= t('devise.mailer.welcome', :email => @resource.email) %> + +<%= t('.you_can_confirm') %> + +[<%= t('.confirm') %>][1] + +[1]: <%= confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %> diff --git a/app/views/devise/mailer/invitation_instructions.erb b/app/views/devise/mailer/invitation_instructions.erb deleted file mode 100644 index 78b55067e..000000000 --- a/app/views/devise/mailer/invitation_instructions.erb +++ /dev/null @@ -1,174 +0,0 @@ -<%- self.extend NotifierHelper -%> -<% @invites = @resource.invitations_to_me.includes(:sender =>{:person => :profile}).where(:admin => false).all %> - - <%=invite_email_title %> - -

<%= t('.displaying_correctly', :link => link_to(t('.view_in'), invite_email_url(:invitation_token => @resource.invitation_token), :style => "color: #3F8FBA; text-decoration: none;")).html_safe %>

- - - - -
- - - - - - - - - - - - - - - - - - - <% unless @invites.blank? %> - <% @invites_with_message, @invites_without_message = @invites.partition{|x| !x.message.blank?} %> - <% unless @invites_with_message.empty? %> - - - - - <% @invites_with_message.each do |i| %> - - <% end %> - <% end %> - - <% unless @invites_without_message.empty? %> - - - - - - <% @invites_without_message.each do |i| %> - - <% end %> - - <% end %> - <% end %> - - - - - - - - - - - - - - - - - - - - - - -
- - Diaspora - -
- <%= t('.finally') %>
-
- -
- <%= t('.arrived', :strong_diaspora => content_tag(:strong, "DIASPORA*")).html_safe %> -
-
- <%= link_to(t('.sign_up_now').html_safe, accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :style => "color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;", :target => "_blank").html_safe %> -
-
- <%= t('.friends_saying') %>
-
- <%= render(:partial => 'devise/mailer/inviter', :locals => {:invite => i}) %> -
-
- <%= t('.more_people') %>
-
- <%= render(:partial => 'devise/mailer/inviter', :locals => {:invite => i}) %> -
- 1. <%= t('.get_connected') %>
- - - - - -
- - - <%= t('.get_connected_paragraph', :strong_diaspora => content_tag(:strong, "DIASPORA*")).html_safe %> -
- -
-
- 2. <%= t('.be_yourself') %>
- - - - - - -
- - <%= t('.be_yourself_paragraph', :strong_diaspora => content_tag(:strong, "DIASPORA*")).html_safe %> - -
- -
- -
-
- 3. <%= t('.have_fun') %>
- - - - - -
- - - - <%= t('.have_fun_paragraph', :strong_diaspora => content_tag(:strong, "DIASPORA*"), :link => link_to(t('.cubbies'), "https://cubbi.es", :style => "color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;", :target => "_blank")).html_safe %> - -
-
- - - - - - -
- <%= link_to(t('.sign_up_now').html_safe, accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :style => "color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;", :target => "_blank").html_safe %> -
-
- - - - - - -
- <%= t('.made_by_people', :strong_diaspora => content_tag(:strong, "DIASPORA*"), :jointeam => link_to(t('.join_team'), "https://github.com/diaspora/diaspora/wiki/Become-a-Contributor", :style =>"color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 18px;", :target => "_blank"), :helpfund => link_to(t('.help_fund'), "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QG4L6VYD8YGPU", :style =>"color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 18px;", :target => "_blank")).html_safe %> - -
-
- <%= t('.love') %>
- <%= t('.team_diaspora') %>
-
- <% if AppConfig[:pod_uri].host.match(/joindiaspora.com/) %> - <%= t('.unsubscribe', :link => link_to(t('.here'), "http://joindiaspora.us1.list-manage.com/unsubscribe?u=d759919b94f9cdcf39d204f3f&id=7b5ceb2f8b", :style => "color: #3F8FBA; text-decoration: none;")).html_safe %> - <% end %> - <%= t('.email_us', :email => link_to(t('.email_address'), "mailto:questions@joindiaspora.com", :style => "color: #3F8FBA; text-decoration: none;")).html_safe %> -
-
diff --git a/app/views/notifier/invite.text.erb b/app/views/devise/mailer/invitation_instructions.markerb similarity index 100% rename from app/views/notifier/invite.text.erb rename to app/views/devise/mailer/invitation_instructions.markerb diff --git a/app/views/devise/mailer/reset_password_instructions.haml b/app/views/devise/mailer/reset_password_instructions.haml deleted file mode 100644 index 58edc9407..000000000 --- a/app/views/devise/mailer/reset_password_instructions.haml +++ /dev/null @@ -1,15 +0,0 @@ -!!! -%html - %head - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - = render :partial => 'notifier/notifier_css' - %body - %header - = image_tag('branding/white.png') - #container - %p - = t('devise.mailer.hello', :email => @resource.email) - %p= t('.someone_requested') - %p= link_to t('.change'), edit_password_url(@resource, :reset_password_token => @resource.reset_password_token), :class => "large_text" - %p= t('.wont_change') - %p.small= t('.ignore') diff --git a/app/views/devise/mailer/reset_password_instructions.markerb b/app/views/devise/mailer/reset_password_instructions.markerb new file mode 100644 index 000000000..840bf053e --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.markerb @@ -0,0 +1,11 @@ +<%= t('devise.mailer.hello', :email => @resource.email) %> + +<%= t('.someone_requested') %> + +[<%= t('.change') %>][1] + +[1]: <%= edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %> + +<%= t('.wont_change') %> + +<%= t('.ignore') %> diff --git a/app/views/devise/mailer/unlock_instructions.haml b/app/views/devise/mailer/unlock_instructions.haml deleted file mode 100644 index 8cdd6038e..000000000 --- a/app/views/devise/mailer/unlock_instructions.haml +++ /dev/null @@ -1,14 +0,0 @@ -!!! -%html - %head - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - = render :partial => 'notifier/notifier_css' - %body - %header - = image_tag('branding/white.png') - #container - %p - = t('devise.mailer.hello', :email => @resource.email) - %p= t('.account_locked') - %p= t('.click_to_unlock') - %p= link_to t('.unlock'), unlock_url(@resource, :unlock_token => @resource.unlock_token), :class => "large_text" diff --git a/app/views/devise/mailer/unlock_instructions.markerb b/app/views/devise/mailer/unlock_instructions.markerb new file mode 100644 index 000000000..15ea9c91c --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.markerb @@ -0,0 +1,9 @@ +<%= t('devise.mailer.hello', :email => @resource.email) %> + +<%= t('.account_locked') %> + +<%= t('.click_to_unlock') %> + +[<%= t('.unlock') %>][1] + +[1]: <%= unlock_url(@resource, :unlock_token => @resource.unlock_token) %> diff --git a/app/views/notifier/also_commented.html.haml b/app/views/notifier/also_commented.html.haml deleted file mode 100644 index 1515779cc..000000000 --- a/app/views/notifier/also_commented.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%p - = comment_message(@notification.comment, :process_newlines => true) -%p - = link_to t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.first_name), post_url(@notification.comment.post) diff --git a/app/views/notifier/also_commented.markerb b/app/views/notifier/also_commented.markerb new file mode 100644 index 000000000..ff2c9b944 --- /dev/null +++ b/app/views/notifier/also_commented.markerb @@ -0,0 +1,5 @@ +<%= comment_message(@notification.comment, :process_newlines => true) %> + +[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.first_name) %>][1] + +[1]: <%= post_url(@notification.comment.post) %> diff --git a/app/views/notifier/also_commented.text.haml b/app/views/notifier/also_commented.text.haml deleted file mode 100644 index 2c78dcd51..000000000 --- a/app/views/notifier/also_commented.text.haml +++ /dev/null @@ -1 +0,0 @@ -!= comment_message(@notification.comment) diff --git a/app/views/notifier/comment_on_post.html.haml b/app/views/notifier/comment_on_post.html.haml deleted file mode 100644 index 1ca9eee49..000000000 --- a/app/views/notifier/comment_on_post.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%p - = comment_message(@notification.comment, :process_newlines => true) -%p - = link_to t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.name), post_url(@notification.comment.post) diff --git a/app/views/notifier/comment_on_post.markerb b/app/views/notifier/comment_on_post.markerb new file mode 100644 index 000000000..c0f52aa2e --- /dev/null +++ b/app/views/notifier/comment_on_post.markerb @@ -0,0 +1,5 @@ +<%= comment_message(@notification.comment, :process_newlines => true) %> + +[<%= t('notifier.comment_on_post.reply', :name => @notification.comment.post.author.name) %>][1] + +[1]: <%= post_url(@notification.comment.post) %> diff --git a/app/views/notifier/comment_on_post.text.haml b/app/views/notifier/comment_on_post.text.haml deleted file mode 100644 index 2c78dcd51..000000000 --- a/app/views/notifier/comment_on_post.text.haml +++ /dev/null @@ -1 +0,0 @@ -!= comment_message(@notification.comment) diff --git a/app/views/notifier/confirm_email.html.haml b/app/views/notifier/confirm_email.html.haml deleted file mode 100644 index bc0cfaf19..000000000 --- a/app/views/notifier/confirm_email.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%p - = t('notifier.hello', :name => @notification.recipient.profile.first_name) -%p - != t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient.unconfirmed_email) - %br - = link_to confirm_email_url(:token => @notification.recipient.confirm_email_token), - confirm_email_url(:token => @notification.recipient.confirm_email_token) diff --git a/app/views/notifier/confirm_email.markerb b/app/views/notifier/confirm_email.markerb new file mode 100644 index 000000000..b24469264 --- /dev/null +++ b/app/views/notifier/confirm_email.markerb @@ -0,0 +1,5 @@ +<%= t('notifier.hello', :name => @notification.recipient.profile.first_name) %> + +<%= t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient.unconfirmed_email) %> + +<<%= confirm_email_url(:token => @notification.recipient.confirm_email_token) %>> diff --git a/app/views/notifier/confirm_email.text.haml b/app/views/notifier/confirm_email.text.haml deleted file mode 100644 index c4c5c1385..000000000 --- a/app/views/notifier/confirm_email.text.haml +++ /dev/null @@ -1,4 +0,0 @@ -!= t('notifier.hello', :name => @notification.recipient.profile.first_name) - -!= t('notifier.confirm_email.click_link', :unconfirmed_email => @notification.recipient.unconfirmed_email) -!= confirm_email_url(:token => @notification.recipient.confirm_email_token) diff --git a/app/views/notifier/invite.html.erb b/app/views/notifier/invite.html.erb deleted file mode 100644 index c5a5f34de..000000000 --- a/app/views/notifier/invite.html.erb +++ /dev/null @@ -1,134 +0,0 @@ - <%- self.extend NotifierHelper -%> - - <%=invite_email_title %> - -

<%= t('devise.mailer.invitation_instructions.displaying_correctly', :link => link_to(t('devise.mailer.invitation_instructions.view_in'), invite_email_url(:invitation_code => @invitation_code), :style => "color: #3F8FBA; text-decoration: none;")).html_safe %>

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Diaspora - -
- <%= t('devise.mailer.invitation_instructions.finally') %>
-
- -
- <%= t('devise.mailer.invitation_instructions.arrived', :strong_diaspora => content_tag(:strong, "DIASPORA*")).html_safe %> -
-
- <%= link_to(t('devise.mailer.invitation_instructions.sign_up_now').html_safe, invite_code_url(@invitation_code), :style => "color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;", :target => "_blank").html_safe %> -
- 1. <%= t('devise.mailer.invitation_instructions.get_connected') %>
- - - - - -
- - - <%= t('devise.mailer.invitation_instructions.get_connected_paragraph', :strong_diaspora => content_tag(:strong, "DIASPORA*")).html_safe %> -
- -
-
- 2. <%= t('devise.mailer.invitation_instructions.be_yourself') %>
- - - - - - -
- - <%= t('devise.mailer.invitation_instructions.be_yourself_paragraph', :strong_diaspora => content_tag(:strong, "DIASPORA*")).html_safe %> - -
- -
- -
-
- 3. <%= t('devise.mailer.invitation_instructions.have_fun') %>
- - - - - -
- - - - <%= t('devise.mailer.invitation_instructions.have_fun_paragraph', :strong_diaspora => content_tag(:strong, "DIASPORA*"), :link => link_to(t('devise.mailer.invitation_instructions.cubbies'), "https://cubbi.es", :style => "color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;", :target => "_blank")).html_safe %> - -
-
- - - - - - -
- <%= link_to(t('devise.mailer.invitation_instructions.sign_up_now').html_safe, invite_code_url(@invitation_code), :style => "color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;", :target => "_blank").html_safe %> -
-
- - - - - - -
- <%= t('devise.mailer.invitation_instructions.made_by_people', :strong_diaspora => content_tag(:strong, "DIASPORA*"), :jointeam => link_to(t('devise.mailer.invitation_instructions.join_team'), "https://github.com/diaspora/diaspora/wiki/Become-a-Contributor", :style =>"color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 18px;", :target => "_blank"), :helpfund => link_to(t('devise.mailer.invitation_instructions.help_fund'), "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QG4L6VYD8YGPU", :style =>"color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 18px;", :target => "_blank")).html_safe %> - -
-
- <%= t('devise.mailer.invitation_instructions.love') %>
- <%= t('devise.mailer.invitation_instructions.team_diaspora') %>
-
- <% if AppConfig[:pod_uri].host.match(/joindiaspora.com/) %> - <%= t('devise.mailer.invitation_instructions.unsubscribe', :link => link_to(t('devise.mailer.invitation_instructions.here'), "http://joindiaspora.us1.list-manage.com/unsubscribe?u=d759919b94f9cdcf39d204f3f&id=7b5ceb2f8b", :style => "color: #3F8FBA; text-decoration: none;")).html_safe %> - <% end %> - <%= t('devise.mailer.invitation_instructions.email_us', :email => link_to(t('devise.mailer.invitation_instructions.email_address'), "mailto:questions@joindiaspora.com", :style => "color: #3F8FBA; text-decoration: none;")).html_safe %> -
-
diff --git a/app/views/notifier/invite.markerb b/app/views/notifier/invite.markerb new file mode 100644 index 000000000..8d39da1c6 --- /dev/null +++ b/app/views/notifier/invite.markerb @@ -0,0 +1 @@ +<%= t('.message', :invite_url => invite_code_url(@invitation_code)) %> diff --git a/app/views/notifier/liked.html.haml b/app/views/notifier/liked.html.haml deleted file mode 100644 index 9e010a59b..000000000 --- a/app/views/notifier/liked.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -%p - = "#{t('.liked', :name => "#{@notification.sender.name}")}:" - -%p{:style => "font-style:italic;color:#666"} - = post_message(@notification.like.target, :process_newlines => true) - -%p - = link_to t('.view_post'), post_url(@notification.like.target) diff --git a/app/views/notifier/liked.markerb b/app/views/notifier/liked.markerb new file mode 100644 index 000000000..10d1fba10 --- /dev/null +++ b/app/views/notifier/liked.markerb @@ -0,0 +1,7 @@ +<%= "#{t('.liked', :name => "#{@notification.sender.name}")}:" %> + +<%= post_message(@notification.like.target, :process_newlines => true) %> + +[<%= t('.view_post') %>][1] + +[1]: <%= post_url(@notification.like.target) %> diff --git a/app/views/notifier/liked.text.haml b/app/views/notifier/liked.text.haml deleted file mode 100644 index f115e8216..000000000 --- a/app/views/notifier/liked.text.haml +++ /dev/null @@ -1,3 +0,0 @@ -!= "#{t('notifier.liked.liked', :name => "#{@notification.sender.name}")}:" -!=post_message(@notification.like.target) - diff --git a/app/views/notifier/mentioned.html.haml b/app/views/notifier/mentioned.html.haml deleted file mode 100644 index 9107eb5de..000000000 --- a/app/views/notifier/mentioned.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%p - = post_message(@notification.post, :process_newlines => true, :length => 600) -%p - = link_to t('notifier.comment_on_post.reply', :name => @notification.post.author.name), post_url(@notification.post) diff --git a/app/views/notifier/mentioned.markerb b/app/views/notifier/mentioned.markerb new file mode 100644 index 000000000..7f790fd0a --- /dev/null +++ b/app/views/notifier/mentioned.markerb @@ -0,0 +1,5 @@ +<%= post_message(@notification.post, :process_newlines => true, :length => 600) %> + +[<%= t('notifier.comment_on_post.reply', :name => @notification.post.author.name) %>][1] + +[1]: <%= post_url(@notification.post) %> diff --git a/app/views/notifier/mentioned.text.haml b/app/views/notifier/mentioned.text.haml deleted file mode 100644 index e628b7f47..000000000 --- a/app/views/notifier/mentioned.text.haml +++ /dev/null @@ -1 +0,0 @@ -!= post_message(@notification.post, :process_newlines => true, :length => 600) diff --git a/app/views/notifier/private_message.html.haml b/app/views/notifier/private_message.html.haml deleted file mode 100644 index 86b134214..000000000 --- a/app/views/notifier/private_message.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%p - = post_message(@notification.message, :process_newlines => true, :length => 2000) -%p - = link_to t('.reply_to_or_view'), conversations_url(:conversation_id => @notification.conversation) diff --git a/app/views/notifier/private_message.markerb b/app/views/notifier/private_message.markerb new file mode 100644 index 000000000..0099546d4 --- /dev/null +++ b/app/views/notifier/private_message.markerb @@ -0,0 +1,5 @@ +<%= post_message(@notification.message, :process_newlines => true, :length => 2000) %> + +[<%= t('.reply_to_or_view') %>][1] + +[1]: <%= conversations_url(:conversation_id => @notification.conversation) %> diff --git a/app/views/notifier/private_message.text.haml b/app/views/notifier/private_message.text.haml deleted file mode 100644 index 8cd710e2b..000000000 --- a/app/views/notifier/private_message.text.haml +++ /dev/null @@ -1 +0,0 @@ -!= @notification.message.text diff --git a/app/views/notifier/reshared.html.haml b/app/views/notifier/reshared.html.haml deleted file mode 100644 index 49c49f66d..000000000 --- a/app/views/notifier/reshared.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -%p - = "#{t('.reshared', :name => "#{@notification.sender.name}")}:" - -%p{:style => "font-style:italic;color:#666"} - = post_message(@notification.reshare.root, :process_newlines => true) - -%p - = link_to t('.view_post'), post_url(@notification.reshare) diff --git a/app/views/notifier/reshared.markerb b/app/views/notifier/reshared.markerb new file mode 100644 index 000000000..36c3e3798 --- /dev/null +++ b/app/views/notifier/reshared.markerb @@ -0,0 +1,7 @@ +<%= "#{t('.reshared', :name => "#{@notification.sender.name}")}:" %> + +<%= post_message(@notification.reshare.root, :process_newlines => true) %> + +[<%= t('.view_post') %>][1] + +[1]: <%= post_url(@notification.reshare) %> diff --git a/app/views/notifier/reshared.text.haml b/app/views/notifier/reshared.text.haml deleted file mode 100644 index 8b7e29e4a..000000000 --- a/app/views/notifier/reshared.text.haml +++ /dev/null @@ -1,3 +0,0 @@ -!= "#{t('notifier.reshared.reshared', :name => "#{@notification.sender.name}")}:" -!=post_message(@notification.reshare.root) - diff --git a/app/views/notifier/single_admin.html.haml b/app/views/notifier/single_admin.html.haml deleted file mode 100644 index 6edcf78b3..000000000 --- a/app/views/notifier/single_admin.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -%p - = t('notifier.hello', :name => @receiver.username) -%p - = @string - - %br - = t('notifier.thanks') - = t('notifier.single_admin.admin') diff --git a/app/views/notifier/single_admin.markerb b/app/views/notifier/single_admin.markerb new file mode 100644 index 000000000..0b9f23749 --- /dev/null +++ b/app/views/notifier/single_admin.markerb @@ -0,0 +1,7 @@ +<%= t('notifier.hello', :name => @receiver.username) %> + +<%= @string %> + +<%= t('notifier.thanks') %> + +<%= t('notifier.single_admin.admin') %> diff --git a/app/views/notifier/single_admin.text.haml b/app/views/notifier/single_admin.text.haml deleted file mode 100644 index e70dc3f4b..000000000 --- a/app/views/notifier/single_admin.text.haml +++ /dev/null @@ -1,6 +0,0 @@ -!= t('notifier.hello', :name => @receiver.username) - -!= @string - -!= t('notifier.thanks') -!= t('notifier.single_admin.admin') diff --git a/app/views/notifier/started_sharing.html.haml b/app/views/notifier/started_sharing.html.haml deleted file mode 100644 index 71c884d33..000000000 --- a/app/views/notifier/started_sharing.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%p - = @notification.sender.name - = t('.sharing') -%p - = link_to t('.view_profile', :name => @notification.sender.first_name), local_or_remote_person_path(@notification.sender, :absolute => true) diff --git a/app/views/notifier/started_sharing.markerb b/app/views/notifier/started_sharing.markerb new file mode 100644 index 000000000..c2f09e842 --- /dev/null +++ b/app/views/notifier/started_sharing.markerb @@ -0,0 +1,5 @@ +<%= @notification.sender.name %> <%= t('.sharing') %> + +[<%= t('.view_profile', :name => @notification.sender.first_name) %>][1] + +[1]: <%= local_or_remote_person_path(@notification.sender, :absolute => true) %> diff --git a/app/views/notifier/started_sharing.text.haml b/app/views/notifier/started_sharing.text.haml deleted file mode 100644 index 1fb5b5d61..000000000 --- a/app/views/notifier/started_sharing.text.haml +++ /dev/null @@ -1,4 +0,0 @@ -!= "#{@notification.sender.name}" -!= t('notifier.started_sharing.sharing') -!= t('.view_profile', :name => @notification.sender.first_name) -!= local_or_remote_person_path(@notification.sender, :absolute => true)