From 22f7c1f721e5a77786f9f61fa219f262784757ac Mon Sep 17 00:00:00 2001 From: Herve Saint-Amand Date: Thu, 12 Jan 2017 22:11:23 +0000 Subject: [PATCH] Dressed up friend_notification mail --- app/models/notifier.rb | 2 ++ app/views/notifier/friend_notification.html.erb | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/models/notifier.rb b/app/models/notifier.rb index 9c566f4fc..d7fa66c4a 100644 --- a/app/models/notifier.rb +++ b/app/models/notifier.rb @@ -129,7 +129,9 @@ class Notifier < ActionMailer::Base @friendurl = url_for(:host => SERVER_URL, :controller => "user", :action => "make_friend", :display_name => @friend.befriender.display_name) + @user_message_author = @friend.befriender.display_name + attach_user_avatar(@friend.befriender) mail :to => friend.befriendee.email, :subject => I18n.t("notifier.friend_notification.subject", :user => friend.befriender.display_name) end diff --git a/app/views/notifier/friend_notification.html.erb b/app/views/notifier/friend_notification.html.erb index 181b2b825..3f260dc92 100644 --- a/app/views/notifier/friend_notification.html.erb +++ b/app/views/notifier/friend_notification.html.erb @@ -1,7 +1,11 @@ -

<%= t 'notifier.friend_notification.had_added_you', :user => @friend.befriender.display_name %>

+<% content_for :body do %> +

<%= t 'notifier.friend_notification.had_added_you', :user => @friend.befriender.display_name %>

-

<%= raw t 'notifier.friend_notification.see_their_profile', :userurl => link_to(@viewurl, @viewurl) %>

+ <%= render "notifier/user_message_table", :captured => capture { %> +

<%= raw t 'notifier.friend_notification.see_their_profile', :userurl => link_to(@viewurl, @viewurl) %>

-<% unless @friend.befriendee.is_friends_with?(@friend.befriender) -%> -

<%= raw t 'notifier.friend_notification.befriend_them', :befriendurl => link_to(@friendurl, @friendurl) %>

-<% end -%> + <% unless @friend.befriendee.is_friends_with?(@friend.befriender) -%> +

<%= raw t 'notifier.friend_notification.befriend_them', :befriendurl => link_to(@friendurl, @friendurl) %>

+ <% end -%> + <% } %> +<% end %> -- 2.43.2