FIX: PM participants listed inline

This commit is contained in:
Jeff Wong
2018-06-11 15:54:39 -07:00
parent 44ee26721a
commit 4599cc8435
7 changed files with 29 additions and 42 deletions

View File

@ -34,9 +34,11 @@ module Email
if @opts[:include_respond_instructions] == false
@template_args[:respond_instructions] = ''
@template_args[:respond_instructions] = I18n.t('user_notifications.pm_participants', @template_args) if @opts[:private_reply]
else
if @opts[:only_reply_by_email]
string = "user_notifications.only_reply_by_email"
string << "_pm" if @opts[:private_reply]
else
string = allow_reply_by_email? ? "user_notifications.reply_by_email" : "user_notifications.visit_link_to_respond"
string << "_pm" if @opts[:private_reply]
@ -96,13 +98,6 @@ module Email
html_override.gsub!("%{respond_instructions}", "")
end
if @template_args[:participants].present?
participants = PrettyText.cook(@template_args[:participants], sanitize: false).html_safe
html_override.gsub!("%{participants}", participants)
else
html_override.gsub!("%{participants}", "")
end
styled = Email::Styles.new(html_override, @opts)
styled.format_basic
if style = @opts[:style]
@ -119,12 +114,6 @@ module Email
body = @opts[:body]
body = I18n.t("#{@opts[:template]}.text_body_template", template_args).dup if @opts[:template]
if @template_args[:participants].present?
body << "\n"
body << @template_args[:participants]
body << "\n"
end
if @template_args[:unsubscribe_instructions].present?
body << "\n"
body << @template_args[:unsubscribe_instructions]

View File

@ -98,6 +98,7 @@ module Email
correct_first_body_margin
correct_footer_style
style('div.undecorated-link-footer a', "font-weight: normal;")
correct_footer_style_hilight_first
reset_tables
onebox_styles
plugin_styles
@ -242,20 +243,26 @@ module Email
end
def correct_footer_style
footernum = 0
@fragment.css('.footer').each do |element|
element['style'] = "color:#666;"
element.css('a').each do |inner|
inner['style'] = "color:#666;"
end
end
end
def correct_footer_style_hilight_first
footernum = 0
@fragment.css('.footer.hilight').each do |element|
linknum = 0
element.css('a').each do |inner|
# we want the first footer link to be specially highlighted as IMPORTANT
if footernum == (0) && linknum == (0)
inner['style'] = "background-color: #006699; color:#ffffff; border-top: 4px solid #006699; border-right: 6px solid #006699; border-bottom: 4px solid #006699; border-left: 6px solid #006699; display: inline-block;"
else
inner['style'] = "color:#666;"
inner['style'] = "background-color: #006699; color:#ffffff; border-top: 4px solid #006699; border-right: 6px solid #006699; border-bottom: 4px solid #006699; border-left: 6px solid #006699; display: inline-block; font-weight: bold;"
end
linknum += 1
return
end
footernum += 1
return
end
end