From 25d80789dda4d989f5b5e168ddd05a20d11c183b Mon Sep 17 00:00:00 2001 From: Herve Saint-Amand Date: Mon, 23 Jan 2017 22:26:34 +0000 Subject: [PATCH] Put the user avatar in a

block This improves rendering on those clients that set the margin to 0 on

blocks. --- app/views/notifier/_message_body.html.erb | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/views/notifier/_message_body.html.erb b/app/views/notifier/_message_body.html.erb index 29ecf9ea8..a108643ce 100644 --- a/app/views/notifier/_message_body.html.erb +++ b/app/views/notifier/_message_body.html.erb @@ -1,15 +1,21 @@ -
- <%= link_to( - image_tag( - attachments["avatar.png"].url, - alt: @author, - title: @author - ), - user_url(@author, :host => SERVER_URL), - :target => "_blank" - ) %> + + <%# Some email clients (e.g. Yahoo as of 2017-01) remove the margin + on

tags. Since the body itself always starts with a

, by + wrapping the image here in a

as well, we ensure that they will at + least always be aligned with each other. %> +

+ <%= link_to( + image_tag( + attachments["avatar.png"].url, + alt: @author, + title: @author + ), + user_url(@author, :host => SERVER_URL), + :target => "_blank" + ) %> +

<%= body %> -- 2.43.2