From 006bb063717f7bf9439db1d12e5e3b78d3e02f47 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Fri, 8 Jan 2016 02:14:58 -0800 Subject: [PATCH] make first email footer link specially highlighted --- lib/email/styles.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/email/styles.rb b/lib/email/styles.rb index 6f0dd6c2b..cfd3f674d 100644 --- a/lib/email/styles.rb +++ b/lib/email/styles.rb @@ -206,11 +206,20 @@ module Email end def correct_footer_style + footernum = 0 @fragment.css('.footer').each do |element| element['style'] = "color:#666;" + linknum = 0 element.css('a').each do |inner| - inner['style'] = "color:#666;" + # we want the first footer link to be specially highlighted as IMPORTANT + if footernum == 0 and linknum == 0 + inner['style'] = "background-color:#006699;color:#fff;padding:4px 6px;" + else + inner['style'] = "color:#666;" + end + linknum += 1 end + footernum += 1 end end