From f6c7a50bba1e9151a0383d96bf9d49e4612075ea Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Fri, 16 Apr 2021 01:08:28 -0700 Subject: [PATCH] Add {committee_review} to emails and support HTML --- app/models/email_settings.rb | 2 ++ app/views/admin/emails/_help.html.haml | 9 ++++++--- app/views/admin/events/_proposal.html.haml | 4 ++-- app/views/mailbot/email_template.html.erb | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/models/email_settings.rb b/app/models/email_settings.rb index 8a8ab0b5..e5b64801 100644 --- a/app/models/email_settings.rb +++ b/app/models/email_settings.rb @@ -91,6 +91,8 @@ class EmailSettings < ApplicationRecord h['eventtitle'] = event.title h['proposalslink'] = Rails.application.routes.url_helpers.conference_program_proposals_url( conference.short_title, host: (ENV['OSEM_HOSTNAME'] || 'localhost:3000')) + h['committee_review'] = event.committee_review + h['committee_review_html'] = ApplicationController.helpers.markdown(event.committee_review) end if booth diff --git a/app/views/admin/emails/_help.html.haml b/app/views/admin/emails/_help.html.haml index 371bac7b..d62589b0 100644 --- a/app/views/admin/emails/_help.html.haml +++ b/app/views/admin/emails/_help.html.haml @@ -17,6 +17,12 @@ %tr %td {eventtitle} %td The title of an accepted or rejected proposal + %tr + %td {committee_review} + %td The raw text in the committee review for the proposal + %tr + %td {committee_review_html} + %td The committee review markdown rendered as HTML. %tr %td {conference_start_date} %td The start date of the conference @@ -56,9 +62,6 @@ %td {conference_splash_link} %td The link to conference splash page - if @conference.booths - %tr - %td {submitter_name} - %td Submitter's name %tr %td {booth_title} %td Booth's title diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 7fe086b1..c21f364f 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -73,7 +73,7 @@ %td = link_to @event.submitter.name, admin_user_path(@event.submitter) - if @event.submitter.email_public - = "(#{mail_to(@event.submitter.email)})" + (#{mail_to(@event.submitter.email)}) %tr %td %b Speakers @@ -82,7 +82,7 @@ %div = link_to speaker.name, admin_user_path(speaker) - if speaker.email_public - = "(#{mail_to(speaker.email)})" + (#{mail_to(speaker.email)}) %tr %td %b Volunteers diff --git a/app/views/mailbot/email_template.html.erb b/app/views/mailbot/email_template.html.erb index 6176cf08..8dd249a0 100644 --- a/app/views/mailbot/email_template.html.erb +++ b/app/views/mailbot/email_template.html.erb @@ -1,7 +1,7 @@ <%= render partial: "layouts/mailbot_header" %>
- <%= @email_body %> + <%= @email_body.html_safe %>
-<%= render partial: "layouts/mailbot_footer" %> \ No newline at end of file +<%= render partial: "layouts/mailbot_footer" %>