Fix conversation emails when replay_to_enabled is false

Fixes COMMS-1116

Test Plan:
  * Have notification service setup to actually send emails
  * Have a user who is setup to receive all notifications immediately
  * Start a new conversation with that user
  * After starting a conversation with that user, send another message
    (reply) to that same conversation.
  * Check the emails, and make sure it doesn't say anything about do not
    reply to this message
  * open config/outgoing_mail.yml, and add this line under the
    development section: `reply_to_disabled: true`
  * Stop and start your rails server to make sure the config changes
    take affect
  * Do all the above steps to send a new conversation and reply to
    conversation
  * Make sure that it now has "Do not reply" in the subject, the bottom
    link now says "Reply to this message in canvas", there there is a
    message in the footer saying to not reply to this email
  * Undo the config change made above

Change-Id: I7b3615d320e43c300d604c203662de97f57b565c
Reviewed-on: https://gerrit.instructure.com/150234
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Landon Gilbert-Bland <lbland@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
This commit is contained in:
Landon Gilbert-Bland 2018-05-14 14:49:18 -06:00 committed by Steven Burnett
parent 117d1b4aba
commit 1586babf4a
4 changed files with 68 additions and 14 deletions

View File

@ -7,12 +7,20 @@
<% end %>
<% define_content :subject do %>
<%= t :subject, "%{user_name}, you just sent a message in Canvas.", :user_name => content(:user_name) %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "%{user_name}, you just sent a message in Canvas.", :user_name => content(:user_name) %>
<% else %>
<%= t "%{user_name}, you just sent a message in Canvas - Do not reply", :user_name => content(:user_name) %>
<% end %>
<% end %>
<% define_content :footer_link do %>
<a href="<%= content :link %>">
<%= t :view_message, "View this message in Conversations" %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "View this message in Conversations" %>
<% else %>
<%= t "Reply to this message in Canvas" %>
<% end %>
</a>
<% end %>
@ -28,7 +36,8 @@
<% elsif IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t("You can reply to this message in Canvas by replying directly to this email, or by clicking this link: %{link}. If you need to include an attachment, please log in to Canvas and reply through the Inbox.", link: content(:link)) %>
<% else %>
<%= t("You can reply to this message in Canvas by clicking this link: %{link}.", link: content(:link)) %>
<%= t"Please do not reply to this email, it will not be delivered." %>
<%= t"You can " %><a href="<%= content :link %>"><%= t"reply to this message in Canvas." %></a>
<% end %>
<% unless asset.attachments.empty? %>

View File

@ -7,12 +7,20 @@
<% end %>
<% define_content :subject do %>
<%= t :subject, "%{user_name}, you just sent a message in Canvas.", :user_name => content(:user_name) %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "%{user_name}, you just sent a message in Canvas.", :user_name => content(:user_name) %>
<% else %>
<%= t "%{user_name}, you just sent a message in Canvas - Do not reply", :user_name => content(:user_name) %>
<% end %>
<% end %>
<% define_content :footer_link do %>
<a href="<%= content :link %>">
<%= t :view_message, "View this message in Conversations" %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "View this message in Conversations" %>
<% else %>
<%= t "Reply to this message in Canvas" %>
<% end %>
</a>
<% end %>
@ -38,7 +46,11 @@
<table border="0" style="font-size: 14px; color: #444444; background-color: #ffffff; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';" valign="top" align="left">
<tr>
<td valign="bottom" align="left">
<b><%= author_short_name%></b>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<b><%= author_short_name%></b>
<% else %>
<b><%= author_short_name%> <%= t"Please do not reply to this email, it will not be delivered." %></b>
<% end %>
</td>
</tr>
<tr>
@ -55,7 +67,11 @@
<% else %>
<p height="30px"></p>
<p>
<b><%= author_short_name%></b>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<b><%= author_short_name%></b>
<% else %>
<b><%= author_short_name%> <%= t"Please do not reply to this email, it will not be delivered." %></b>
<% end %>
<br/>
<a href="<%= content :link %>">
<%= author_email_address%>
@ -67,6 +83,8 @@
<p><%= t :audio_comment, "This message includes media comments. To listen or reply, click the link below:" %></p>
<% elsif IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<p><%= t :reply_to_conversation_message, "You can reply to this message in Canvas by replying directly to this email. If you need to include an attachment, please log in to Canvas and reply through the Inbox." %></p>
<% else %>
<p><%=t :pre_you_can, "You can "%><a href="<%= content :link %>"><%= t"reply to this message in Canvas." %></a></p>
<% end %>
<% unless asset.attachments.empty? %>

View File

@ -7,12 +7,20 @@
<% end %>
<% define_content :subject do %>
<%= t :subject, "%{user_name} just sent you a message in Canvas.", :user_name => content(:user_name) %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "%{user_name} just sent you a message in Canvas.", :user_name => content(:user_name) %>
<% else %>
<%= t "%{user_name}, you just sent a message in Canvas - Do not reply", :user_name => content(:user_name) %>
<% end %>
<% end %>
<% define_content :footer_link do %>
<a href="<%= content :link %>">
<%= t :view_message, "View this message in Conversations" %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "View this message in Conversations" %>
<% else %>
<%= t "Reply to this message in Canvas" %>
<% end %>
</a>
<% end %>
@ -27,7 +35,8 @@
<% elsif IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t("You can reply to this message in Canvas by replying directly to this email, or by clicking this link: %{link}. If you need to include an attachment, please log in to Canvas and reply through the Inbox.", link: content(:link)) %>
<% else %>
<%= t("You can reply to this message in Canvas by clicking this link: %{link}.", link: content(:link)) %>
<%= t"Please do not reply to this email, it will not be delivered." %>
<%= t"You can " %><a href="<%= content :link %>"><%= t"reply to this message in Canvas." %></a>
<% end %>
<% unless asset.attachments.empty? %>

View File

@ -7,12 +7,20 @@
<% end %>
<% define_content :subject do %>
<%= t :subject, "%{user_name} just sent you a message in Canvas.", :user_name => content(:user_name) %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "%{user_name} just sent you a message in Canvas.", :user_name => content(:user_name) %>
<% else %>
<%= t "%{user_name} just sent you a message in Canvas - Do not reply", :user_name => content(:user_name) %>
<% end %>
<% end %>
<% define_content :footer_link do %>
<a href="<%= content :link %>">
<%= t :view_message, "View this message in Conversations" %>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<%= t "View this message in Conversations" %>
<% else %>
<%= t "Reply to this message in Canvas" %>
<% end %>
</a>
<% end %>
@ -38,7 +46,11 @@
<table border="0" style="font-size: 14px; color: #444444; background-color: #ffffff; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';" valign="top" align="left">
<tr>
<td valign="bottom" align="left">
<b><%= author_short_name%></b>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<b><%= author_short_name%></b>
<% else %>
<b><%= author_short_name%> <%= t"Please do not reply to this email, it will not be delivered." %></b>
<% end %>
</td>
</tr>
<tr>
@ -55,7 +67,11 @@
<% else %>
<p height="30px"></p>
<p>
<b><%= author_short_name%></b>
<% if IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<b><%= author_short_name%></b>
<% else %>
<b><%= author_short_name%> <%= t"Please do not reply to this email, it will not be delivered." %></b>
<% end %>
<br/>
<a href="mailto:<%= author_email_address %>">
<%= author_email_address%>
@ -67,6 +83,8 @@
<p><%= t :audio_comment, "This message includes media comments. To listen or reply, click the link below:" %></p>
<% elsif IncomingMailProcessor::MailboxAccount.reply_to_enabled %>
<p><%= t :reply_to_conversation_message, "You can reply to this message in Canvas by replying directly to this email. If you need to include an attachment, please log in to Canvas and reply through the Inbox." %></p>
<% else %>
<p><%=t :pre_you_can, "You can " %><a href="<%= content :link %>"><%= t"reply to this message in Canvas." %></a></p>
<% end %>
<% unless asset.attachments.empty? %>