Skip to content

Commit

Permalink
Merge pull request #149 from TelosLabs/mail-status
Browse files Browse the repository at this point in the history
Update session reminder mail subject
  • Loading branch information
LuigiR0jas authored Sep 3, 2024
2 parents 1444100 + 9ecbdce commit afc223b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions app/notifiers/session_reminder_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ def title
end

def subject
t("mailers.session_mailer.reminder.subject", title: record.title)
end

def email_title
if params[:time_before_session].match?(/^0\s/)
t("mailers.session_mailer.reminder.subject.without_time")
t("mailers.session_mailer.reminder.title.without_time")
else
t("mailers.session_mailer.reminder.subject.with_time", time_before_session: params[:time_before_session])
t("mailers.session_mailer.reminder.title.with_time", time_before_session: params[:time_before_session])
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/session_mailer/reminder.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="u-w-full">
<div class="container">
<h1 class="title"><%= @notification&.subject %></h1>
<h1 class="title"><%= @notification&.email_title %></h1>
<div class="c-event-card">
<div class="c-event-card__title">
<%= link_to @session.title, sessions_url, style: "color: #CB0C1C; text-decoration: none;" %>
Expand Down
3 changes: 2 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ en:
mailers:
session_mailer:
reminder:
subject:
subject: "%{title} is starting soon"
title:
with_time: "Your bookmarked session is starting in %{time_before_session}."
without_time: "Your bookmarked session is starting soon."
password_mailer:
Expand Down

0 comments on commit afc223b

Please sign in to comment.