From ee7c906f1773230e52b544d0767a60709ddc6e8a Mon Sep 17 00:00:00 2001 From: Jimmy Date: Thu, 11 Mar 2021 21:10:26 -0800 Subject: [PATCH] [feat] Modify alt text for logo; Support user-defined color for header and footer --- app/views/layouts/_mailbot_footer.html.erb | 7 ++++-- app/views/layouts/_mailbot_header.html.erb | 13 ++++++---- app/views/mailbot/comment_template.html.erb | 24 ++++++++++--------- app/views/mailbot/email_template.html.erb | 8 ++++--- .../ticket_confirmation_template.html.erb | 20 +++++++++------- ...kers_ticket_confirmation_template.html.erb | 24 ++++++++++--------- 6 files changed, 55 insertions(+), 41 deletions(-) diff --git a/app/views/layouts/_mailbot_footer.html.erb b/app/views/layouts/_mailbot_footer.html.erb index 4f479cc7..fc3d88a4 100644 --- a/app/views/layouts/_mailbot_footer.html.erb +++ b/app/views/layouts/_mailbot_footer.html.erb @@ -7,8 +7,11 @@ <%= stylesheet_link_tag "mailbot" %> - + <% if @conference.present? && @conference.color.present? %> +
+ <% else %> +
+ <% end %>
-
\ No newline at end of file diff --git a/app/views/layouts/_mailbot_header.html.erb b/app/views/layouts/_mailbot_header.html.erb index e0f182a7..674b56a5 100644 --- a/app/views/layouts/_mailbot_header.html.erb +++ b/app/views/layouts/_mailbot_header.html.erb @@ -9,18 +9,21 @@ <%= stylesheet_link_tag "mailbot" %> - -
+ + <% if @conference.present? && @conference.color.present? %> +
+ <% else %> +
+ <% end %>
<% if @logo_url.present? %> - <%= image_tag(@logo_url, style: "display:block;height:70px;width:auto;", alt: 'conference logo') %> + <%= image_tag(@logo_url, style: "display:block;height:70px;width:auto;", alt: @conference.title + ' logo') %> <% end %>
-
- + \ No newline at end of file diff --git a/app/views/mailbot/comment_template.html.erb b/app/views/mailbot/comment_template.html.erb index 2f5158e8..b9e9cce0 100644 --- a/app/views/mailbot/comment_template.html.erb +++ b/app/views/mailbot/comment_template.html.erb @@ -1,14 +1,16 @@ <%= render partial: "layouts/mailbot_header" %> - - Dear <%= @user.name %>, +
+ + Dear <%= @user.name %>, - User <%= @comment.user.name %> posted a new comment for event <%= @event.title %> of <%= @conference.short_title %> . - - "<%= @comment.body %>" - - To reply to this comment, please go to <%= h(admin_conference_program_event_url(@conference.short_title, @event, only_path: false)) %> - - Best wishes, - <%= @conference.title %> Team - + User <%= @comment.user.name %> posted a new comment for event <%= @event.title %> of <%= @conference.short_title %> . + + "<%= @comment.body %>" + + To reply to this comment, please go to <%= h(admin_conference_program_event_url(@conference.short_title, @event, only_path: false)) %> + + Best wishes, + <%= @conference.title %> Team + +
<%= render partial: "layouts/mailbot_footer" %> \ No newline at end of file diff --git a/app/views/mailbot/email_template.html.erb b/app/views/mailbot/email_template.html.erb index fd8ae362..6176cf08 100644 --- a/app/views/mailbot/email_template.html.erb +++ b/app/views/mailbot/email_template.html.erb @@ -1,5 +1,7 @@ <%= render partial: "layouts/mailbot_header" %> - - <%= @email_body %> - +
+ + <%= @email_body %> + +
<%= render partial: "layouts/mailbot_footer" %> \ No newline at end of file diff --git a/app/views/mailbot/ticket_confirmation_template.html.erb b/app/views/mailbot/ticket_confirmation_template.html.erb index 51e83f9c..f92284d7 100644 --- a/app/views/mailbot/ticket_confirmation_template.html.erb +++ b/app/views/mailbot/ticket_confirmation_template.html.erb @@ -1,12 +1,14 @@ <%= render partial: "layouts/mailbot_header" %> - - Dear <%= @user.name %>, +
+ + Dear <%= @user.name %>, - Thanks! You have successfully booked <%= @ticket_purchase.quantity %> <%= @ticket_purchase.ticket.title %> ticket(s) for the event <%= @conference.title %>. Your transaction id is <%= @ticket_purchase.id %>. - - Please, find the ticket(s) pdf attached. - - Best wishes, - <%= @conference.title %> Team - + Thanks! You have successfully booked <%= @ticket_purchase.quantity %> <%= @ticket_purchase.ticket.title %> ticket(s) for the event <%= @conference.title %>. Your transaction id is <%= @ticket_purchase.id %>. + + Please, find the ticket(s) pdf attached. + + Best wishes, + <%= @conference.title %> Team + +
<%= render partial: "layouts/mailbot_footer" %> \ No newline at end of file diff --git a/app/views/mailbot/young_thinkers_ticket_confirmation_template.html.erb b/app/views/mailbot/young_thinkers_ticket_confirmation_template.html.erb index 44d3c2a0..d35d8a1f 100644 --- a/app/views/mailbot/young_thinkers_ticket_confirmation_template.html.erb +++ b/app/views/mailbot/young_thinkers_ticket_confirmation_template.html.erb @@ -1,14 +1,16 @@ <%= render partial: "layouts/mailbot_header" %> - - Dear <%= @user.name %>, +
+ + Dear <%= @user.name %>, - Thanks! You have successfully booked <%= @ticket_purchase.quantity %> <%= @ticket_purchase.ticket.title %> ticket(s) for the event <%= @conference.title %>. Your transaction id is <%= @ticket_purchase.id %>. - - Please, find the ticket(s) pdf attached. - - The SAP Young Thinkers team will reach out to you with information on how to participate in the event soon. In the meantime, you can check the event page (https://events.sap.com/yt-learning-festival-at-snapcon-2020/en/home) or send an email with your questions to youngthinkers@sap.com. - - Best wishes, - <%= @conference.title %> Team - + Thanks! You have successfully booked <%= @ticket_purchase.quantity %> <%= @ticket_purchase.ticket.title %> ticket(s) for the event <%= @conference.title %>. Your transaction id is <%= @ticket_purchase.id %>. + + Please, find the ticket(s) pdf attached. + + The SAP Young Thinkers team will reach out to you with information on how to participate in the event soon. In the meantime, you can check the event page (https://events.sap.com/yt-learning-festival-at-snapcon-2020/en/home) or send an email with your questions to youngthinkers@sap.com. + + Best wishes, + <%= @conference.title %> Team + +
<%= render partial: "layouts/mailbot_footer" %> \ No newline at end of file