HTMLify the outbound email messages and update the /messages UI
All of the outbound email notifications have been updated to have a matching HTML version of the email in order for us to send multi- part emails. There has also been some tweaking of the other email messages (summary, plain text, etc) with a better looking layout fixes CNVS-4728 fixes CNVS-4795 test steps: - generate email messages for each template and review the results in the users message list view (/users/1/messages) Change-Id: I1fd9cf2b134209e42c8d174f19b50963e6502f6a Reviewed-on: https://gerrit.instructure.com/18942 Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Marc LeGendre <marc@instructure.com> Reviewed-by: Zach Pendleton <zachp@instructure.com> Product-Review: Eric Berry <ericb@instructure.com>
This commit is contained in:
parent
c25b4bbea6
commit
ffd0fe56c3
|
@ -22,8 +22,11 @@ require [
|
|||
'jst/messages/sendForm'
|
||||
'compiled/jquery/fixDialogButtons'
|
||||
'jqueryui/dialog'
|
||||
'jqueryui/tabs'
|
||||
], (I18n, $, sendForm) ->
|
||||
|
||||
$(".tabs").tabs()
|
||||
|
||||
showDialog = (e) ->
|
||||
e.preventDefault()
|
||||
$message = $(e.target).parents('li.message:first')
|
||||
|
|
|
@ -39,4 +39,13 @@ class MessagesController < ApplicationController
|
|||
IncomingMessageProcessor.process_single(message, secure_id, message_id)
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
def html_message
|
||||
message = @context.messages.find(params[:message_id])
|
||||
if message.html_body.present?
|
||||
render :inline => message.html_body, :layout => false
|
||||
else
|
||||
render :layout => false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
<html>
|
||||
<body style="background-color: #EAEAEA; background-image: url(<%= "#{HostUrl.protocol}://#{HostUrl.context_host(asset_context)}" %>/images/noisy-gray.jpg);">
|
||||
<body style="background-color: #EAEAEA;">
|
||||
|
||||
<center>
|
||||
<table cellpadding="8" cellspacing="0" style="margin: 0; padding: 0; width:528px;" border="0">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table cellpadding="0" cellspacing="0" align="center" border="0" style="background-color: #ffffff; border-left: 1px #D2D2D2 solid; border-right: 1px #D2D2D2 solid; border-top: 1px #D2D2D2 solid;">
|
||||
<tr>
|
||||
<td align="left" style="font-size: 0px;" height="1">
|
||||
<div style="padding: 15px;">
|
||||
<img src="<%= "#{HostUrl.protocol}://#{HostUrl.context_host(asset_context)}" %>/images/canvas-email.png" style="height: 40px;" height="40">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table cellpadding="0" cellspacing="0" style="border-bottom: 1px #D2D2D2 solid;" border="0" align="center">
|
||||
|
@ -23,7 +16,7 @@
|
|||
<td width="36"></td>
|
||||
<td width="454" style="font-size: 14px; color: #444444; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif'; border-collapse: collapse;" align="left" valign="top">
|
||||
|
||||
<%= yield %>
|
||||
<%= inner_html %>
|
||||
|
||||
</td>
|
||||
<td width="36"></td>
|
||||
|
@ -43,8 +36,8 @@
|
|||
<td style="padding: 0; border-collapse: collapse;">
|
||||
<table cellpadding="0" cellspacing="0" align="center" border="0">
|
||||
<tr style="font-size: 11px; color: #a8b9c6; font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';" valign="top">
|
||||
<td width="400" align="left"><a href="<%= "#{HostUrl.protocol}://#{HostUrl.context_host(asset_context)}/profile/communication" %>" style="color: #555555;">
|
||||
<%= t 'click_to_preferences', "click here to edit your notification preferences" %></a></td>
|
||||
<td width="400" align="left"><a href="<%= "#{HostUrl.protocol}://#{HostUrl.default_host}/profile/communication" %>" style="color: #555555;">
|
||||
<%= t 'click_to_preferences', "Click here to edit your notification preferences" %></a></td>
|
||||
<td width="128" align="right">© <%= Time.now.year %> Instructure</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.account) %>/accounts/<%= asset.account_id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Account Admin Notification" %>
|
||||
<% end %>
|
||||
<p>
|
||||
<%= t('#messages.account_user_registration.email.added_message', "You've been added as an %{role_type} to the account %{account} at %{website}.",
|
||||
:role_type => asset.readable_type,
|
||||
:account => asset.account.name,
|
||||
:website => HostUrl.context_host(asset.account)) %>
|
||||
</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t(:url_info, "Visit the account page") %></a></p>
|
|
@ -0,0 +1,38 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.account) %>/register/<%= asset.user.communication_channel.confirmation_code %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Canvas Account Admin Invitation" %>
|
||||
<% end %>
|
||||
<% email = asset.user.email; login = (asset.user.pseudonym.unique_id rescue "none") %>
|
||||
|
||||
<p>
|
||||
<%= t(:added_message, "You've been added as an %{role_type} to the account %{account} at %{website}.",
|
||||
:role_type => asset.readable_type,
|
||||
:account => asset.account.name,
|
||||
:website => HostUrl.context_host(asset.account)) %>
|
||||
</p>
|
||||
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:name, 'Name') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.user.name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px"><%= t(:email, 'Email') %>:</td>
|
||||
<td style="font-weight: bold;"><%= email %></td>
|
||||
</tr>
|
||||
<% if email != login %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:username, 'Username') %>:</td>
|
||||
<td style="font-weight: bold;"><%= login %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<p><%= t(:url_info_label, "You'll need to register with Canvas before you can participate as an account admin.") %></p>
|
||||
|
||||
<p><a href="<%= content(:link) %>"><%= t(:click_to_finish_registration, "Click here to finish the registration process") %></a></p>
|
|
@ -0,0 +1,13 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/conversations/<%= asset.conversation_id %>
|
||||
<% end %>
|
||||
<% define_content :user_name do %>
|
||||
<%= asset.author.short_name_with_shared_contexts(user) rescue t(:unknown_user, "Unknown User") %>
|
||||
<% end %>
|
||||
<% define_content :subject do -%>
|
||||
<%= t :subject, "%{user_name} just added you to a conversation in Canvas.", :user_name => content(:user_name) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "%{user_name} just added you to a conversation in Canvas.", :user_name => content(:user_name) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, "View Conversation" %></a></p>
|
|
@ -0,0 +1,33 @@
|
|||
<% define_content :link do %>
|
||||
<%= polymorphic_url asset_context.course %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Alert: %{user_name}', :user_name => asset_context.user.name) %>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<%=
|
||||
if asset_context.user_id == user.id
|
||||
t('body_student', {:one => "An alert has been triggered for you because the following condition has been met:", :other => "An alert has been triggered for you because the following conditions have been met:"}, :count => asset.criteria.length)
|
||||
else
|
||||
t('body', {:one => "An alert has been triggered for %{student} because the following condition has been met:", :other => "An alert has been triggered for %{student} because the following conditions have been met:"}, :count => asset.criteria.length, :student => asset_context.user.name)
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
|
||||
<% asset.criteria.each do |criterion| %>
|
||||
<p><em style="color: #ff0000;"><%=
|
||||
case criterion.criterion_type
|
||||
when 'Interaction'
|
||||
t('interaction_description', 'No student/teacher interaction for %{count} days', :count => criterion.threshold)
|
||||
when 'UngradedCount'
|
||||
t('ungraded_count_description', '%{count} or more submissions have not been graded', :count => criterion.threshold)
|
||||
when 'UngradedTimespan'
|
||||
t('ungraded_timespan_description', 'A submission has been left ungraded for %{count} days', :count => criterion.threshold)
|
||||
when 'UserNote'
|
||||
t('usernote_description', 'No faculty journal entries for %{count} days', :count => criterion.threshold)
|
||||
end
|
||||
%></em></p>
|
||||
<% end %>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t('view_here', 'You can view it here') %></a></p>
|
|
@ -0,0 +1,58 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.appointment_group.contexts.first) %>/appointment_groups/<%= asset.appointment_group.id %>
|
||||
<% end %>
|
||||
|
||||
<% courses = asset.appointment_group.participant_type == 'Group' ?
|
||||
asset.appointment_group.contexts.first.name :
|
||||
asset.appointment_group.contexts_for_user(user).map(&:name).join(", ") %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Reservation canceled for %{appointment_name} (%{course})', :appointment_name => asset.title, :course => courses) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :message, '%{user} canceled his/her reservation for %{appointment_name}.', :user => data.updating_user.name, :appointment_name => asset.title %></p>
|
||||
|
||||
<strong><%= t :details, 'Appointment Details' %>:</strong>
|
||||
<p>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :date_and_time, 'Date/Time' %>:</td>
|
||||
<td valign="top"><%= datetime_string(asset.start_at, asset.end_at) %></td>
|
||||
</tr>
|
||||
<% if asset.appointment_group.participant_type == 'Group' -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendees, 'Attendees' %>:</td>
|
||||
<td valign="top"><%= asset.participants.map(&:name).to_sentence %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :group, 'Group' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% else -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendee, 'Attendee' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if asset.appointment_group.available_slots -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :slots_remaining, 'Available time slots' %>:</td>
|
||||
<td valign="top"><%= asset.appointment_group.available_slots %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<p style="font-weight: bold;"><%= t :cancel_reason, 'Reason for canceling' %></p>
|
||||
<p><%= data.cancel_reason || t(:no_reason_given, "none given") %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><%= t :view_appointment, 'View the appointment at the following link' %>:</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t 'click_to_see_assignment', 'Click here to view the assignment' %></a></p>
|
|
@ -0,0 +1,54 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.appointment_group.contexts.first) %>/appointment_groups/<%= asset.appointment_group.id %>
|
||||
<% end %>
|
||||
|
||||
<% courses = asset.appointment_group.participant_type == 'Group' ?
|
||||
asset.appointment_group.contexts.first.name :
|
||||
asset.appointment_group.contexts_for_user(user).map(&:name).join(", ") %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Your time slot for %{appointment_name} has been canceled (%{course})', :appointment_name => asset.title, :course => courses) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :message, '%{user} canceled your time slot for %{appointment_name}.', :user => data.updating_user.name, :appointment_name => asset.title %></p>
|
||||
|
||||
<strong><%= t :details, 'Appointment Details' %>:</strong>
|
||||
<p>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :date_and_time, 'Date/Time' %>:</td>
|
||||
<td valign="top"><%= datetime_string(asset.start_at, asset.end_at) %></td>
|
||||
</tr>
|
||||
<% if asset.appointment_group.participant_type == 'Group' -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendees, 'Attendees' %>:</td>
|
||||
<td valign="top"><%= asset.participants.map(&:name).to_sentence %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :group, 'Group' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% else -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendee, 'Attendee' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :course, 'Course' %>:</td>
|
||||
<td valign="top"><%= courses %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="font-weight: bold;"><%= t :cancel_reason, 'Reason for canceling' %></p>
|
||||
<p><%= data.cancel_reason || t(:no_reason_given, "none given") %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'Click here to sign up for a different time slot' %></a></p>
|
|
@ -0,0 +1,40 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.contexts.first) %>/appointment_groups
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Appointments for %{appointment_name} have been canceled (%{course})', :appointment_name => asset.title, :course => asset.contexts_for_user(user).map(&:name).join(", ")) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :message, 'All appointments for %{appointment_name} have been canceled.', :appointment_name => asset.title %></p>
|
||||
|
||||
<p><strong><%= t :details, 'Appointment Details' %>:</strong></p>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<% if asset.end_at %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :dates, 'Date(s)' %>:</td>
|
||||
<td valign="top"><%= date_string(asset.start_at, asset.end_at, :no_words) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :course, 'Course' %>:</td>
|
||||
<td valign="top"><%=
|
||||
asset.participant_type == 'Group' ?
|
||||
asset.contexts.first.name :
|
||||
asset.contexts_for_user(user).map(&:name).join(", ") %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p style="font-weight: bold;"><%= t :cancel_reason, 'Reason for canceling' %></p>
|
||||
<p><%= data.cancel_reason || t(:no_reason_given, "none given") %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the appointment' %></a></p>
|
|
@ -0,0 +1,49 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.contexts.first) %>/appointment_groups/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Appointment "%{appointment_name}" is available for signup (%{course})',
|
||||
:appointment_name => asset.title,
|
||||
:course => asset.contexts_for_user(user).map(&:name).join(", ")) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :message, 'Time slots for "%{appointment_name}" are now available for signup.', :appointment_name => asset.title %></p>
|
||||
|
||||
<p><strong><%= t :details, 'Appointment Details' %>:</strong></p>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :dates, "Date(s)" %>:</td>
|
||||
<td valign="top"><%= date_string(asset.start_at, asset.end_at, :no_words) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :signup_type, "Signup Type" %>:</td>
|
||||
<td valign="top"><%= asset.participant_type == 'Group' ?
|
||||
t(:group_signup, "Group (%{group_category})", :group_category => asset.sub_contexts.first.name) :
|
||||
t(:individual_signup, "Individual") %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :course, "Course" %>:</td>
|
||||
<td valign="top"><%= asset.participant_type == 'Group' ?
|
||||
asset.contexts.first.name :
|
||||
asset.contexts_for_user(user).map(&:name).join(", ") %></td>
|
||||
</tr>
|
||||
<% if asset.available_slots -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :slots_remaining, 'Available time slots' %>:</td>
|
||||
<td valign="top"><%= asset.available_slots %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'Sign up for a time slot' %></a></p>
|
|
@ -0,0 +1,46 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.contexts.first) %>/appointment_groups/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Appointment "%{appointment_name}" has been updated (%{course})', :appointment_name => asset.title, :course => asset.contexts_for_user(user).map(&:name).join(", ")) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :message, 'Time slots have been added to "%{appointment_name}" and are available for signup.', :appointment_name => asset.title %></p>
|
||||
|
||||
<p><strong><%= t :details, 'Appointment Details' %>:</strong></p>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :dates, "Date(s)" %>:</td>
|
||||
<td valign="top"><%= date_string(asset.start_at, asset.end_at, :no_words) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= asset.participant_type == 'Group' ?
|
||||
t(:group_signup, "Group (%{group_category})", :group_category => asset.sub_contexts.first.name) :
|
||||
t(:individual_signup, "Individual") %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :course, "Course" %>:</td>
|
||||
<td valign="top"><%= asset.participant_type == 'Group' ?
|
||||
asset.contexts.first.name :
|
||||
asset.contexts_for_user(user).map(&:name).join(", ") %></td>
|
||||
</tr>
|
||||
<% if asset.available_slots -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :slots_remaining, 'Available time slots' %>:</td>
|
||||
<td valign="top"><%= asset.available_slots %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'Sign up for a time slot' %></a></p>
|
|
@ -0,0 +1,57 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.appointment_group.contexts.first) %>/appointment_groups/<%= asset.appointment_group.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'User signed up for "%{appointment_name}" (%{course})', :appointment_name => asset.title, :course => asset.appointment_group.contexts_for_user(user).map(&:name).join(", ")) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :message, '%{user} has signed up for "%{appointment_name}".', :user => data.updating_user.name, :appointment_name => asset.title %></p>
|
||||
|
||||
<p><strong><%= t :details, 'Appointment Details' %>:</strong></p>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :date_and_time, 'Date/time' %>:</td>
|
||||
<td valign="top"><%= datetime_string(asset.start_at, asset.end_at) %></td>
|
||||
</tr>
|
||||
<% if asset.appointment_group.participant_type == 'Group' -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendees, 'Attendees' %>:</td>
|
||||
<td valign="top"><%= asset.participants.map(&:name).to_sentence %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :group, 'Group' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendee, 'Attendee' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :course, 'Course' %>:</td>
|
||||
<td valign="top"><%=
|
||||
asset.appointment_group.participant_type == 'Group' ?
|
||||
asset.appointment_group.contexts.first.name :
|
||||
asset.appointment_group.contexts_for_user(user).map(&:name).join(", ") %></td>
|
||||
</tr>
|
||||
<% if asset.appointment_group.available_slots -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :slots_remaining, 'Available time slots' %>:</td>
|
||||
<td valign="top"><%= asset.appointment_group.available_slots %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the appointment' %></a></p>
|
|
@ -0,0 +1,56 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.appointment_group.contexts.first) %>/appointment_groups/<%= asset.appointment_group.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'You have been signed up for "%{appointment_name}"', :appointment_name => asset.title) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :message, '%{user} has signed you up for "%{appointment_name}".', :user => data.updating_user.name, :appointment_name => asset.title %></p>
|
||||
|
||||
<p><strong><%= t :details, 'Appointment Details' %>:</strong></p>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :date_and_time, 'Date/time' %>:</td>
|
||||
<td valign="top"><%= datetime_string(asset.start_at, asset.end_at) %></td>
|
||||
</tr>
|
||||
<% if asset.appointment_group.participant_type == 'Group' -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendees, 'Attendees' %>:</td>
|
||||
<td valign="top"><%= asset.participants.map(&:name).to_sentence %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :group, 'Group' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :attendee, 'Attendee' %>:</td>
|
||||
<td valign="top"><%= asset.context.name %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :course, 'Course' %>:</td>
|
||||
<td valign="top"><%= asset.appointment_group.participant_type == 'Group' ?
|
||||
asset.appointment_group.contexts.first.name :
|
||||
asset.appointment_group.contexts_for_user(user).map(&:name).join(", ") %></td>
|
||||
</tr>
|
||||
<% if asset.appointment_group.available_slots -%>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;" valign="top"><%= t :slots_remaining, 'Available time slots' %>:</td>
|
||||
<td valign="top"><%= asset.appointment_group.available_slots %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'Sign up for a different time slot' %></a></p>
|
|
@ -0,0 +1,11 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/assignments/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Assignment Changed: %{title}, %{course}", :title => asset.title, :course => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, 'The assignment "%{title}" for %{course} has changed.', :title => asset.title, :course => asset.context.name %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click here to view the assignment" %></a></p>
|
|
@ -0,0 +1,40 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/assignments/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('assignment_created', 'Assignment Created - %{assignment_name}, %{course_name}', :assignment_name => asset.title, :course_name => asset.context.name) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('new_assignment', 'A new assignment has been created for your course, %{course_name}',
|
||||
:course_name => asset.context.name) %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p style="font-weight: bold;"><%= asset.title %></p>
|
||||
|
||||
<p>
|
||||
<% if asset.multiple_due_dates_apply_to?(user) %>
|
||||
<%= t('multiple_due_dates', 'due: Multiple Dates') %>
|
||||
<% elsif asset.due_at %>
|
||||
<%= t('due_at', 'Due: %{assignment_due_date_time}', :assignment_due_date_time => datetime_string(force_zone(asset.due_at))) %>
|
||||
<% else %>
|
||||
<%= t('no_due_date', 'No Due Date') %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the assignment' %></a></p>
|
|
@ -0,0 +1,21 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/assignments/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('assignment_due_date_changed', 'Assignment Due Date Changed: %{assignment_name}, %{course_name}', :assignment_name => asset.title, :course_name => asset.context.name) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('assignment_due_date_changed_sentence', 'The due date for the assignment, %{assignment_name}, for the course, %{course_name}, has changed to:',
|
||||
:assignment_name => asset.title,
|
||||
:course_name => asset.context.name) %></p>
|
||||
|
||||
<p>
|
||||
<% if asset.due_at %>
|
||||
<%= datetime_string(force_zone(asset.due_at)) %>
|
||||
<% else %>
|
||||
<%= t('no_due_date', 'No Due Date') %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the assignment' %></a></p>
|
|
@ -0,0 +1,24 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.assignment.context) %>/<%= asset.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.assignment.context_id %>/assignments/<%= asset.assignment.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('assignment_due_date_changed', 'Assignment Due Date Changed: %{assignment_name}, %{course_name} (%{override})',
|
||||
:assignment_name => asset.assignment.title,
|
||||
:course_name => asset.assignment.context.name,
|
||||
:override => asset.title) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('assignment_due_date_changed_sentence', 'The due date for the assignment, %{assignment_name}, for the course, %{course_name} (%{override}), has changed to:',
|
||||
:assignment_name => asset.assignment.title,
|
||||
:course_name => asset.assignment.context.name,
|
||||
:override => asset.title) %></p>
|
||||
<p>
|
||||
<% if asset.due_at %>
|
||||
<%= datetime_string(force_zone(asset.due_at)) %>
|
||||
<% else %>
|
||||
<%= t('no_due_date', 'No Due Date') %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the assignment' %></a></p>
|
|
@ -0,0 +1,11 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/assignments/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('assignment_graded', 'Assignment Graded: %{assignment_name}, %{course_name}', :assignment_name => asset.title, :course_name => asset.context.name) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('the_assignment_is_graded', 'The assignment, %{assignment_name}, has been graded.', :assignment_name => asset.title) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the assignment' %></a></p>
|
|
@ -0,0 +1,16 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.assignment.context) %>/<%= asset.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.assignment.context_id %>/assignments/<%= asset.assignment_id %>/submissions/<%= asset.user_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('user_resubmitted', 'Re-Submission: %{user_name}, %{assignment_name}',
|
||||
:user_name => asset.user.name,
|
||||
:assignment_name => asset.assignment.title) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('user_resubmitted_sentence', '%{user_name} has just turned in a re-submission for %{assignment_name} in the course %{course_name}',
|
||||
:user_name => asset.user.name,
|
||||
:assignment_name => asset.assignment.title,
|
||||
:course_name => asset.assignment.context.name) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the submission' %></a></p>
|
|
@ -0,0 +1,16 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.assignment.context) %>/<%= asset.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.assignment.context_id %>/assignments/<%= asset.assignment_id %>/submissions/<%= asset.user_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('user_submitted', 'Submission: %{user_name}, %{assignment_name}',
|
||||
:user_name => asset.user.name,
|
||||
:assignment_name => asset.assignment.title) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('user_submitted_sentence', '%{user_name} has just turned in a submission for %{assignment_name} in the course %{course_name}',
|
||||
:user_name => asset.user.name,
|
||||
:assignment_name => asset.assignment.title,
|
||||
:course_name => asset.assignment.context.name) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the submission' %></a></p>
|
|
@ -0,0 +1,14 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.assignment.context) %>/<%= asset.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.assignment.context_id %>/assignments/<%= asset.assignment_id %>/submissions/<%= asset.user_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('user_submitted', 'Late Assignment: %{user_name}, %{assignment_name}', :user_name => asset.user.name, :assignment_name => asset.assignment.title) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('user_resubmitted_sentence', '%{user_name} has just turned in a late submission for %{assignment_name} in the course %{course_name}',
|
||||
:user_name => asset.user.name,
|
||||
:assignment_name => asset.assignment.title,
|
||||
:course_name => asset.assignment.context.name) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_text, 'View the submission' %></a></p>
|
|
@ -0,0 +1,11 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/assignments/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Assignment Unmuted: %{title}, %{course}", :title => asset.title, :course => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "Your instructor has released grade changes and new comments for %{title}. These changes are now viewable.", :title => asset.title %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "You can view it here" %></a></p>
|
|
@ -0,0 +1,30 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.collaboration.context) %>/<%= asset.collaboration.context.class.base_ar_class.to_s.downcase.pluralize %>/<%= asset.collaboration.context_id %>/collaborations/<%= asset.collaboration.id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Collaboration Invitation: %{course_or_group}", :course_or_group => asset.collaboration.context.name %>
|
||||
<% end %>
|
||||
<p>
|
||||
<% if asset.collaboration.user %>
|
||||
<%= t :body_with_user,
|
||||
"You've been invited to collaborate on a document, %{document} for %{course_or_group}. The document was created by %{user} in %{service} and you were invited using your email address, %{email}.",
|
||||
:document => asset.collaboration.title,
|
||||
:course_or_group => asset.collaboration.context.name,
|
||||
:user => asset.collaboration.user.short_name,
|
||||
:service => asset.collaboration.service_name,
|
||||
:email => asset.user.gmail %>
|
||||
<% else %>
|
||||
<%= t :body,
|
||||
"You've been invited to collaborate on a document, %{document} for %{course_or_group}. The document was created in %{service} and you were invited using your email address, %{email}.",
|
||||
:document => asset.collaboration.title,
|
||||
:course_or_group => asset.collaboration.context.name,
|
||||
:service => asset.collaboration.service_name,
|
||||
:email => asset.user.gmail %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><%= t :change_profile_settings,
|
||||
"If that's the wrong email address for this type of collaboration, you'll need to change your profile settings or register with %{service}.",
|
||||
:service => asset.collaboration.service_name %></p>
|
||||
|
||||
<p><a href="%{link}"><%= t :link, "You can see the details here" %></a></p>
|
|
@ -0,0 +1,14 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset_context) || HostUrl.default_host %>/register/<%= asset.confirmation_code %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Confirm Email: Canvas" %>
|
||||
<% end %>
|
||||
<p>
|
||||
<%= t :body,
|
||||
"The email address, %{email} is being registered at %{website} for the user, %{user}.",
|
||||
:email => asset.path,
|
||||
:website => HostUrl.context_host(asset_context) || HostUrl.default_host,
|
||||
:user => asset.user.name %>
|
||||
</p>
|
||||
<p><a href="<%= content :link %>"><%= t :details, "Click here to confirm this registration" %></a></p>
|
|
@ -0,0 +1,15 @@
|
|||
<% p = asset.is_a?(Pseudonym) ? asset : (asset.pseudonym || asset.user.pseudonym) %>
|
||||
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
|
||||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host((p.account rescue nil)) %>/register/<%= cc.confirmation_code %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Confirm Registration: Canvas" %>
|
||||
<% end %>
|
||||
<p><%= t :body,
|
||||
"Thank you for registering with Canvas! This email is confirmation that the user %{user} is registering for a new account at %{website}.",
|
||||
:user => asset.user.short_name,
|
||||
:website => (HostUrl.context_host((p.account rescue nil)) || HostUrl.default_host) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :details, "Click here to finish the registration process" %></a></p>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.course) %>/<%= asset.course.class.to_s.downcase.pluralize %>/<%= asset.course_id %>/content_exports
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Course Export Failed: %{course}", :course => asset.course.name %>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<%= t :body, <<-BODY, :course => asset.course.name
|
||||
There was a problem exporting the course <em>%{course}</em>.
|
||||
Please notify your system administrator, and give them the following export identifier:
|
||||
BODY
|
||||
%>
|
||||
</p>
|
||||
|
||||
<p><strong>ContentExport:<%= asset.id %></strong></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click to view exports" %></a></p>
|
|
@ -0,0 +1,9 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.course) %>/<%= asset.course.class.to_s.downcase.pluralize %>/<%= asset.course_id %>/content_exports
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Course Export Finished: %{course}", :course => asset.course.name %>
|
||||
<% end %>
|
||||
<p><%= t :body, %{Your course export for <em>%{course}</em> has finished.}, :course => asset.course.name %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click to view exports" %></a></p>
|
|
@ -0,0 +1,47 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/conversations/<%= asset.conversation_id %>
|
||||
<% end %>
|
||||
<% define_content :user_name do %>
|
||||
<%= asset.author.short_name_with_shared_contexts(user) rescue t(:unknown_user, "Unknown User") %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "%{user_name} just sent you a message in Canvas.", :user_name => content(:user_name) %>
|
||||
<% end %>
|
||||
<p><%= t :body, "%{user_name} just sent you a message in Canvas:", :user_name => content(:user_name) %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><%= asset.body.gsub(/\n/,'</p><p>') %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<% if asset.has_media_objects? %>
|
||||
<p><%= t :audio_comment, "This message includes media comments. To listen or reply, click the link below:" %></p>
|
||||
<% else %>
|
||||
<p><%= t :reply_message, "To reply to this message, click the link below:" %></p>
|
||||
<% end %>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= content :link %></a></p>
|
||||
|
||||
<% unless asset.attachments.empty? %>
|
||||
<div style="margin-top: 20px; padding: 10px; border: 1px solid #f1f1f1; background-color: #f3f3f3;">
|
||||
<p style="margin: 0px;"><%= t :attached_files, "Attached Files:" %></p>
|
||||
<ul style="padding-left: 20px;">
|
||||
<% asset.attachments.each do |attachment| %>
|
||||
<li><%= attachment.display_name %> - <%= attachment.readable_size %> <a href="<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/files/<%= attachment.id %>/download?verifier=<%= attachment.uuid %>">[<%= t :download, "download" %>] %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
|
@ -0,0 +1,22 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.course) %>/<%= asset.course.class.to_s.downcase.pluralize %>/<%= asset.course_id %>/details
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "%{user} accepted the Course Invitation", :user => asset.user.name %>
|
||||
<% end %>
|
||||
<p><%=
|
||||
case asset.type
|
||||
when 'TeacherEnrollment'
|
||||
t :body_teacher, "%{user} just accepted their invitation to participate in the course, %{course}, as a teacher.", :user => asset.user.name, :course => asset.course.name
|
||||
when 'TaEnrollment'
|
||||
t :body_ta, "%{user} just accepted their invitation to participate in the course, %{course}, as a TA.", :user => asset.user.name, :course => asset.course.name
|
||||
when 'ObserverEnrollment'
|
||||
t :body_observer, "%{user} just accepted their invitation to participate in the course, %{course}, as an observer.", :user => asset.user.name, :course => asset.course.name
|
||||
when 'DesignerEnrollment'
|
||||
t :body_designer, "%{user} just accepted their invitation to participate in the course, %{course}, as a designer.", :user => asset.user.name, :course => asset.course.name
|
||||
else
|
||||
t :body_student, "%{user} just accepted their invitation to participate in the course, %{course}, as a student.", :user => asset.user.name, :course => asset.course.name
|
||||
end
|
||||
%></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :details, "See the list of current enrollments" %></a></p>
|
|
@ -0,0 +1,47 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.course) %>/<%= asset.course.class.to_s.downcase.pluralize %>/<%= asset.course_id %>?invitation=<%= asset.uuid %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Course Invitation" %>
|
||||
<% end %>
|
||||
<% email = asset.user.email; login = (asset.user.pseudonym.unique_id rescue "none") %>
|
||||
|
||||
<p>
|
||||
<%=
|
||||
case asset.type
|
||||
when 'TeacherEnrollment'
|
||||
t :body_teacher, "You've been invited to participate in the course, %{course}, as a teacher.", :course => asset.course.name
|
||||
when 'TaEnrollment'
|
||||
t :body_ta, "You've been invited to participate in the course, %{course}, as a TA.", :course => asset.course.name
|
||||
when 'ObserverEnrollment'
|
||||
t :body_observer, "You've been invited to participate in the course, %{course}, as an observer.", :course => asset.course.name
|
||||
when 'DesignerEnrollment'
|
||||
t :body_designer, "You've been invited to participate in the course, %{course}, as a designer.", :course => asset.course.name
|
||||
else
|
||||
t :body_student, "You've been invited to participate in the course, %{course}, as a student.", :course => asset.course.name
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:name, 'Name') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.user.name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px"><%= t(:email, 'Email') %>:</td>
|
||||
<td style="font-weight: bold;"><%= email %></td>
|
||||
</tr>
|
||||
<% if email != login %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:username, 'Username') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.user.pseudonym.unique_id rescue t(:none, "none") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<p><a href="<%= content(:link) %>"><%= t(:link, "Click here to view the course page") %></a></p>
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.course) %>/<%= asset.course.class.to_s.downcase.pluralize %>/<%= asset.course_id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Course Enrollment" %>
|
||||
<% end %>
|
||||
<% email = asset.user.email; login = (asset.user.pseudonym.unique_id rescue "none") %>
|
||||
<% course = "<a href=\"#{content :link}\">#{asset.course.name}</a>" %>
|
||||
<p>
|
||||
<%=
|
||||
case asset.type
|
||||
when 'TeacherEnrollment'
|
||||
t :body_teacher, "You've been enrolled in the course, %{course}, as a teacher.", :course => course
|
||||
when 'TaEnrollment'
|
||||
t :body_ta, "You've been enrolled in the course, %{course}, as a TA.", :course => course
|
||||
when 'ObserverEnrollment'
|
||||
t :body_observer, "You've been enrolled in the course, %{course}, as an observer.", :course => course
|
||||
when 'DesignerEnrollment'
|
||||
t :body_designer, "You've been enrolled in the course, %{course}, as a designer.", :course => course
|
||||
else
|
||||
t :body_student, "You've been enrolled in the course, %{course}, as a student.", :course => course
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:name, 'Name') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.user.name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px"><%= t(:email, 'Email') %>:</td>
|
||||
<td style="font-weight: bold;"><%= email %></td>
|
||||
</tr>
|
||||
<% if email != login %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:username, 'Username') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.user.pseudonym.unique_id rescue t(:none, "none") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<% if !asset.user.registered? && asset.user.communication_channel %>
|
||||
<p><a href="<%= registration_confirmation_url(asset.user.communication_channel.confirmation_code, :host => HostUrl.context_host(asset.course)) %>"><%= t :complete_registration_link, "Click here to complete registration" %></a></p>
|
||||
<% end %>
|
|
@ -0,0 +1,54 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.course) %>/<%= asset.course.class.to_s.downcase.pluralize %>/<%= asset.course_id %>?invitation=<%= asset.uuid %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Course Invitation" %>
|
||||
<% end %>
|
||||
|
||||
<% website = HostUrl.context_host(asset.course) %>
|
||||
<p><%= t :participate_in_class, "You've been invited to participate in a class at %{website}", :website => website %></p>
|
||||
<p>
|
||||
<%=
|
||||
case asset.type
|
||||
when 'TeacherEnrollment'
|
||||
t :body_teacher, "The class is called %{course}, and you've been invited to participate as a teacher.",
|
||||
:course => asset.course.name
|
||||
when 'TaEnrollment'
|
||||
t :body_ta, "The class is called %{course}, and you've been invited to participate as a TA.",
|
||||
:course => asset.course.name
|
||||
when 'ObserverEnrollment'
|
||||
t :body_observer, "The class is called %{course}, and you've been invited to participate as a observer.",
|
||||
:course => asset.course.name
|
||||
when 'DesignerEnrollment'
|
||||
t :body_designer, "The class is called %{course}, and you've been invited to participate as a designer.",
|
||||
:course => asset.course.name
|
||||
else
|
||||
t :body_student, "The class is called %{course}, and you've been invited to participate as a student.",
|
||||
:course => asset.course.name
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
<% email = asset.user.email; login = (asset.user.pseudonym.unique_id rescue "none") %>
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:name, 'Name') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.user.name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px"><%= t(:email, 'Email') %>:</td>
|
||||
<td style="font-weight: bold;"><%= email %></td>
|
||||
</tr>
|
||||
<% if email != login %>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:username, 'Username') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.user.pseudonym.unique_id rescue t(:none, "none") %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<p><%= t :details, "You'll need to register with Canvas before you can participate in the class." %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click here to get started" %></a></p>
|
|
@ -0,0 +1,22 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context_type.underscore.pluralize %>/<%= asset.context_id %>/calendar_events/<%= asset.id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Event Date Changed: %{event_title}, %{course_name}', :event_title => asset.title, :course_name => asset.context.name) %>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
<%= t('email_body', "The event, %{event_title}, for the course, %{course_name}, has changed times. It's now:", :event_title => asset.title, :course_name => asset.context.name) %>
|
||||
</p>
|
||||
|
||||
<p><em style="color: #00ae00;">
|
||||
<% if !asset.start_at && !asset.end_at %>
|
||||
<%= t('no_time_set', 'No Time Set') %>
|
||||
<% elsif (asset.start_at == asset.end_at || !asset.end_at) %>
|
||||
<%= datetime_string(force_zone(asset.start_at)) %>
|
||||
<% else %>
|
||||
<%= t('from_to_time', 'from %{start_date_time} to %{end_date_time}', :start_date_time => datetime_string(force_zone(asset.start_at)), :end_date_time => datetime_string(force_zone(asset.end_at))) %>
|
||||
<% end %>
|
||||
</em></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t 'see_details', 'You can see details here' %></a></p>
|
|
@ -0,0 +1,28 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(((asset.pseudonym || asset.user.pseudonym).account rescue nil)) %>/login
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Forgot Password: Canvas') %>
|
||||
<% end %>
|
||||
<p><%= t('requested_password_reset', 'You requested a confirmation of your password for logging into Canvas.') %></p>
|
||||
|
||||
<% if asset.active_pseudonyms.length > 1 -%>
|
||||
<p><%= before_label('associated_with_accounts', 'This address is associated with the following accounts') %></p>
|
||||
|
||||
<% asset.active_pseudonyms.each do |p| %>
|
||||
<p>- <%= t('login_at_account', '%{login_email} at %{account_name}', :login_email => p.unique_id, :account_name => p.account.display_name) %><br/>
|
||||
<% if p.managed_password? %>
|
||||
<%= t('login_managed_by_account', "this login's credentials are managed by %{account_name}", :account_name => p.account.name) %>
|
||||
<% else %>
|
||||
<%= before_label('change_password_at', "change this login's password at") %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host((p.account rescue nil)) %>/pseudonyms/<%= p.id %>/change_password/<%= (p.communication_channel || asset).confirmation_code %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p><%= t('associated_login', 'This address is associated with the login, "%{login_identifier}".', :login_identifier => asset.active_pseudonyms.first.unique_id) %></p>
|
||||
<% if asset.active_pseudonyms.first.managed_password? %>
|
||||
<p><%= t('password_from_account', "The password for this login should have been given to you by the system administrators at %{account_name}, and Instructure doesn't have access to your password. If your password is not working, please contact the system administrators about changing or verifying your password.", :account_name => asset.active_pseudonyms.first.account.display_name) %></p>
|
||||
<% else %>
|
||||
<p><a href="<%= HostUrl.protocol %>://<%= HostUrl.context_host((asset.active_pseudonyms.first.account rescue nil)) %>/pseudonyms/<%= asset.active_pseudonyms.first.id %>/change_password/<%= asset.confirmation_code %>"><%= t('click_to_reset', 'Click here to set a new password') %></a><% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,22 @@
|
|||
<% course = asset.is_a?(Course) ? asset : asset.context %>
|
||||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset) %>/<%= course.class.to_s.downcase.pluralize %>/<%= course.id %>/assignments
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= before_label('subject', 'Grade Weight Changed') %> <%= asset.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('grade_changed', "The grading policy for the course, %{course_name} has changed.", :course_name => course.name) %></p>
|
||||
|
||||
<% if course.group_weighting_scheme == 'percent' %>
|
||||
<p>
|
||||
<%= before_label('grades_based_on_percent', 'Grading is based on the weighted total for each assignment group') %>
|
||||
<% course.assignment_groups.each do |group |%>
|
||||
<br/>- <%= group.name %>: <%= group.group_weight %>%
|
||||
<% end %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p><%= t('grading_based_on_points', 'Grading is based on total points for all assignments.') %></p>
|
||||
<% end %>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= before_label('now_see_here', 'You can see details here') %></a></p>
|
|
@ -0,0 +1,14 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.assignment.context) %>/<%= asset.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.assignment.context_id %>/assignments/<%= asset.assignment_id %>/submissions/<%= asset.user_id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Late Assignment: %{group_name}, %{assignment_name}', :group_name => asset.group.name, :assignment_name => asset.assignment.title) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('body', "The group %{group_name} has just turned in a late submission for %{assignment_name} in the course %{course_name}.",
|
||||
:group_name => asset.group.name,
|
||||
:assignment_name => asset.assignment.title,
|
||||
:course_name => asset.assignment.context.name) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :view_submission_here, 'You can view the submission here' %></a></p>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.group.context) %>/<%= asset.group.context.class.to_s.downcase.pluralize %>/<%= asset.group.context_id %>/groups/<%= asset.group_id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Group Membership Accepted: %{group_name}', :group_name => asset.group.name) %>
|
||||
<% end %>
|
||||
<p><%= t('group_request_accepted', 'Group Request Accepted: %{group_name}', :group_name => asset.group.name) %></p>
|
||||
|
||||
<p>
|
||||
<% if asset.group.context.class.to_s == 'Account' %>
|
||||
<%= t('account_group', "Your request to join the group %{group_name} for the account %{account_name} has been accepted.", :group_name => asset.group.name, :account_name => asset.group.context.name) %>
|
||||
<% elsif asset.group.context.class.to_s == 'Course' %>
|
||||
<%= t('course_group', "Your request to join the group %{group_name} for the course %{course_name} has been accepted.", :group_name => asset.group.name, :course_name => asset.group.context.name) %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click to check out the group" %></a></p>
|
|
@ -0,0 +1,17 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.group.context) %>/<%= asset.group.context.class.to_s.downcase.pluralize %>/<%= asset.group.context_id %>/groups
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'Group Membership Rejected: %{group_name}', :group_name => asset.group.name) %>
|
||||
<% end %>
|
||||
<p><%= t('group_request_rejected', 'Group Request Rejected: %{group_name}', :group_name => asset.group.name) %></p>
|
||||
|
||||
<p>
|
||||
<% if asset.group.context.class.to_s == 'Account' %>
|
||||
<%= t('account_group', "Your request to join the group %{group_name} for the account %{account_name} has been rejected.", :group_name => asset.group.name, :account_name => asset.group.context.name) %>
|
||||
<% elsif asset.group.context.class.to_s == 'Course' %>
|
||||
<%= t('course_group', "Your request to join the group %{group_name} for the course %{course_name} has been rejected.", :group_name => asset.group.name, :course_name => asset.group.context.name) %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click to view other groups" %></a></p>
|
|
@ -0,0 +1,10 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.default_host %>/register/<%= asset.confirmation_code %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'New Canvas Account') %>
|
||||
<% end %>
|
||||
<% url = (HostUrl.context_host((asset.pseudonym || asset.user.pseudonym).account) rescue nil) || HostUrl.default_host %>
|
||||
<p><%= t :account_created, "An account has been created for you at %{url}, but you already have a Canvas account.", :url => url %></p>
|
||||
<p><%= t :merge, "If you would like to merge them together, <a href=\"%{link}\">click here</a>", :link => content(:link) %></p>
|
|
@ -0,0 +1,11 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/imports/migrate/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Your content for \"%{course_name}\" is ready to be imported", :course_name => asset.migration_settings[:course_name] %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "Your content is ready to be imported into your course." %></p>
|
||||
|
||||
<p><%= t :link_message, "Click <a href=\"%{link}\">this link</a> to choose which items of your content to import", :link => content(:link) %></p>
|
|
@ -0,0 +1,11 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/imports/list
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Content Import Failed: %{course_name}", :course_name => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "There was a problem importing some content into your course %{destination}.", :destination => asset.context.name %></p>
|
||||
|
||||
<p><%= t :notify_admin, "Please notify your system administrator, and point them to your <a href=\"%{link}\">import info page</a>", :link => content(:link) %></p>
|
|
@ -0,0 +1,28 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Course Import Finished: %{course_name}", :course_name => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<% if asset.warnings.blank? %>
|
||||
<p>
|
||||
<%= t :body_no_warnings, "Importing %{source} into %{destination} has finished. Everything you selected should now be imported into your course.",
|
||||
:source => asset.migration_settings[:course_name],
|
||||
:destination => asset.context.name %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p>
|
||||
<%= t :body_with_warnings, "Importing %{source} into %{destination} has finished, but not everything was imported successfully:",
|
||||
:source => asset.migration_settings[:course_name],
|
||||
:destination => asset.context.name %>
|
||||
</p>
|
||||
<ul>
|
||||
<% asset.warnings.each do |warning| %>
|
||||
<li><%= warning %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click to view the course" %></a></p>
|
|
@ -0,0 +1,9 @@
|
|||
<% define_content :link do %><%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.account) %><% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Account User" %>
|
||||
<% end %>
|
||||
<p><%= t :body, "New Account Admin for %{account}", :account => asset.account.name %></p>
|
||||
|
||||
<p><%= t :details, "A new admin, %{user}, has been added for the account %{account}", :user => asset.user.name, :account => asset.account.name %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= content :link %></a></p>
|
|
@ -0,0 +1,21 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.base_ar_class.to_s.downcase.pluralize %>/<%= asset.context_id %>/announcements/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= before_label asset.title %> <%= asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= asset.message.gsub(/\n/, '</p><p>') %></p>
|
||||
|
||||
<% if asset.attachment %>
|
||||
<div style="margin-top: 20px; padding: 10px; border: 1px solid #f1f1f1; background-color: #f3f3f3;">
|
||||
<p style="margin: 0px;"><%= t :attached_file, "Attached File" %></p>
|
||||
<ul style="padding-left: 20px;">
|
||||
<li><%= asset.attachment.display_name %> - <%= asset.attachment.readable_size %>
|
||||
<a href="<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.base_ar_class.to_s.downcase.pluralize %>/<%= asset.context_id %>/files/<%= asset.attachment_id %>/download">[<%= t :download, "download" %>]</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "View announcement" %></a></p>
|
|
@ -0,0 +1,30 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.group.context) %>/<%= asset.group.context.class.to_s.downcase.pluralize %>/<%= asset.group.context_id %>/groups
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Group Membership for %{course_or_account}", :course_or_account => asset.group.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :title, "New Group Membership: %{group_name}", :group_name => asset.group.name %></p>
|
||||
|
||||
<p>
|
||||
<%=
|
||||
case asset.group.context_type
|
||||
when 'Account'
|
||||
t :body_account, "You've been added to a new group for the account %{account}. The name of the group is %{group_name}.", :account => asset.group.context.name, :group_name => asset.group.name
|
||||
else
|
||||
t :body_course, "You've been added to a new group for the course %{course}. The name of the group is %{group_name}.", :course => asset.group.context.name, :group_name => asset.group.name
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%=
|
||||
case asset.group.context_type
|
||||
when 'Account'
|
||||
t :html_details_account, "You can see which groups you're a part of for this account by <a href=\"%{link}\">clicking here</a>", :link => content(:link)
|
||||
else
|
||||
t :html_details_course, "You can see which groups you're a part of for this course by <a href=\"%{link}\">clicking here</a>", :link => content(:link)
|
||||
end
|
||||
%>
|
||||
</p>
|
|
@ -0,0 +1,20 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.group.context) %>/<%= asset.group.context.class.to_s.downcase.pluralize %>/<%= asset.group.context_id %>/groups/<%= asset.group_id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Group Membership for %{course_or_account}", :course_or_account => asset.group.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :title, "New Group Membership: %{group_name}", :group_name => asset.group.name %></p>
|
||||
<p>
|
||||
<%=
|
||||
case asset.group.context_type
|
||||
when 'Account'
|
||||
t :body_account, "You've been invited to join the group %{group} for the account %{account}.", :group => asset.group.name, :account => asset.group.context.name
|
||||
else
|
||||
t :body_course, "You've been invited to join the group %{group} for the course %{course}.", :group => asset.group.name, :course => asset.group.context.name
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :details, "You can check out the group by clicking here" %></a></p>
|
|
@ -0,0 +1,33 @@
|
|||
<% define_content :link do %><%= HostUrl.protocol %>://<%= HostUrl.context_host(asset) %>/courses/<%= asset.id %><% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Course" %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :title, "New Course for %{account}", :account => asset.root_account.name %></p>
|
||||
|
||||
<p><%= t :body, "A course, %{course}, has been added for the account %{account}", :course => asset.name, :account => asset.root_account.name %></p>
|
||||
|
||||
<% if !asset.teachers.empty? %>
|
||||
<p>
|
||||
<strong><%= before_label :teachers, "Teachers" %></strong>
|
||||
<ul style="padding: 0; list-style: none;">
|
||||
<% asset.teachers.each do |teacher| %>
|
||||
<li>
|
||||
<a href="<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset) %>/users/<%= teacher.id %>"><%= teacher.name %></a>
|
||||
<% if teacher.email %>(<%= teacher.email %>)<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<hr style="border: 0;
|
||||
margin-top: 15px;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click here to view the course" %></a></p>
|
|
@ -0,0 +1,29 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/discussion_topics/<%= asset.discussion_topic_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Comment for %{discussion_topic}: %{course}", :discussion_topic => asset.title, :course => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "%{user} posted a new comment on the thread %{discussion_topic} for %{course}:", :user => asset.user.short_name, :discussion_topic => asset.title, :course => asset.context.name %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><%= html_to_text(asset.message).gsub(/\n/, '</p><p>') %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :details, "Click here to join the conversation" %></a></p>
|
|
@ -0,0 +1,42 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/discussion_topics/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Discussion - %{discussion_topic}: %{course}", :discussion_topic => asset.title, :course => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "A new discussion has been started that may be interesting to you:" %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><strong><%= asset.title %></strong></p>
|
||||
|
||||
<p><%= strip_and_truncate(asset.message, :max_length => 5000).gsub(/\n/, '</p><p>') %></p>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<% if asset.attachment %>
|
||||
<div style="margin-top: 20px; padding: 10px; border: 1px solid #f1f1f1; background-color: #f3f3f3;">
|
||||
<p style="margin: 0px;"><%= t :attached_file, "Attached File" %></p>
|
||||
<ul style="padding-left: 20px;">
|
||||
<li><%= asset.attachment.display_name %> - <%= asset.attachment.readable_size %>
|
||||
<a href="<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/files/<%= asset.attachment_id %>/download">[<%= t :download, "download" %>]</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :details, "Join the conversation here" %></a></p>
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context_type.underscore.pluralize %>/<%= asset.context_id %>/calendar_events/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t('subject', 'New Event - %{event_title}, %{course_name}', :event_title => asset.title, :course_name => asset.context.name) %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t('body', "There's a new event scheduled for %{course_name} that you should be aware of:", :course_name => asset.context.name) %></p>
|
||||
|
||||
<p><strong><%= asset.title %></strong></p>
|
||||
|
||||
<p><em style="color: #00ae00;">
|
||||
<% if !asset.start_at && !asset.end_at %>
|
||||
<%= t('no_time_set', 'No Time Set') %>
|
||||
<% elsif (asset.start_at == asset.end_at || !asset.end_at) %>
|
||||
<%= datetime_string(force_zone(asset.start_at)) %>
|
||||
<% else %>
|
||||
<%= t('from_to_time', 'from %{start_date_time} to %{end_date_time}', :start_date_time => datetime_string(force_zone(asset.start_at)), :end_date_time => datetime_string(force_zone(asset.end_at))) %>
|
||||
<% end %>
|
||||
</em></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t 'see_details', 'You can see details here' %></a></p>
|
|
@ -0,0 +1,13 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/files/<%= asset.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
New File Added: <%= asset.title %>, <%= asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p>A new file has been added for the course, <%= asset.context.name %>:</p>
|
||||
|
||||
<p><%= asset.title %> <span style="font-size: 11px; color: #777;">(<%= asset.readable_size %>)</span></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click to view" %></a></p>
|
|
@ -0,0 +1,11 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/files
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= data.count %> New Files Added to <%= asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= data.count %> new files have been added for the course, <%= asset.context.name %>.</p>
|
||||
|
||||
<p><a href="<%= content :link %>">You can view them here</a></p>
|
|
@ -0,0 +1,21 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.group.context) %>/<%= asset.group.context.class.to_s.downcase.pluralize %>/<%= asset.group.context_id %>/groups/<%= asset.group.id %>
|
||||
<% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Student Group for %{course_or_account}", :course_or_account => asset.group.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :title, "New Student Group: %{group_name}", :group_name => asset.group.name %></p>
|
||||
|
||||
<p>
|
||||
<%=
|
||||
case asset.group.context_type
|
||||
when 'Account'
|
||||
t :body_account, %{A new student organized group named "%{group_name}" was created for the account %{account}. The first member is %{user}.}, :group_name => asset.group.name, :account => asset.group.context.name, :user => asset.user.name
|
||||
else
|
||||
t :body_course, %{A new student organized group named "%{group_name}" was created for the course %{course}. The first member is %{user}.}, :group_name => asset.group.name, :course => asset.group.context.name, :user => asset.user.name
|
||||
end
|
||||
%>
|
||||
</p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :details, "Click here to see details for this group" %></a></p>
|
|
@ -0,0 +1,27 @@
|
|||
<% define_content :link do %><%= HostUrl.protocol %>://<%= HostUrl.default_host %>/users/<%= asset.id %><% end %>
|
||||
<% define_content :subject do %><%= t :subject, "New Teacher Registration" %><% end %>
|
||||
|
||||
<p><%= t :body, "%{user} just registered as a teacher at %{website}.", :user => asset.name, :website => (HostUrl.context_host(asset.latest_pseudonym.account) rescue nil) || HostUrl.default_host %></p>
|
||||
|
||||
<table border="0" style="font-size: 14px; color: #444444;
|
||||
font-family: 'Open Sans', 'Lucida Grande', 'Segoe UI', Arial, Verdana, 'Lucida Sans Unicode', Tahoma, 'Sans Serif';
|
||||
border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:school_name, 'School Name') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.school_name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px"><%= t(:school_position, 'School Position') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.school_position %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:phone, 'Phone') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.phone %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-right: 10px;"><%= t(:email, 'Email') %>:</td>
|
||||
<td style="font-weight: bold;"><%= asset.email %></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click here to view teacher" %></a></p>
|
|
@ -0,0 +1,8 @@
|
|||
<% define_content :link do %><%= HostUrl.protocol %>://<%= HostUrl.default_host %>/users/<%= asset.id %><% end %>
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New User" %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "A new user, %{user}, has just registered for the account %{account}", :user => asset.name, :account => asset.account.name %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click here to view user" %></a></p>
|
|
@ -0,0 +1,17 @@
|
|||
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
|
||||
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
|
||||
<% define_content :link do %>
|
||||
<% if p.user.registered? %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host((p.account rescue nil)) %>/pseudonyms/<%= p.id %>/change_password/<%= cc.confirmation_code %>
|
||||
<% else %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host((p.account rescue nil)) %>/register/<%= cc.confirmation_code %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Finish Registration: Canvas" %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "You have been registered for a Canvas account at %{account}! Before you can log in and start using Canvas, you'll need to finish the configuration process.", :account => p.account.display_name %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link, "Click here to finish the registration process" %></a></p>
|
|
@ -0,0 +1,13 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/accounts/<%= asset.account_id %>/files/<%= asset.attachment_id %>/download
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Report Generated" %>
|
||||
<% end %>
|
||||
|
||||
<p><strong><%= t :subject, "Report Generated" %></strong></p>
|
||||
|
||||
<p><%= asset.message %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "Click here to download the report" %></a></p>
|
|
@ -0,0 +1,5 @@
|
|||
<% define_content :subject do %><%= t :subject, "Report Generation Failed" %><% end %>
|
||||
|
||||
<p><strong><%= t :subject, "Report Generation Failed" %></strong></p>
|
||||
|
||||
<p><%= asset.message %></p>
|
|
@ -0,0 +1,13 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.rubric_association.context) %>/<%= asset.rubric_association.context.class.to_s.downcase.pluralize %>/<%= asset.rubric_association.context_id %>/rubric_associations/<%= asset.rubric_association_id %>/assessments/<%= asset.uuid %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Assessment Invitation: %{rubric}, %{context}", :rubric => asset.rubric_association.title, :context => asset.rubric_association.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "You've been invited by %{user} to assess their submission for %{rubric}:", :user => asset.user.name, :rubric => asset.rubric_association.title %></p>
|
||||
|
||||
<p><strong><%= asset.rubric_association.description %></strong></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "Click here to review and evaluate the entry" %></a></p>
|
|
@ -0,0 +1,13 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.submission.assignment.context) %>/<%= asset.submission.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.submission.assignment.context_id %>/assignments/<%= asset.submission.assignment_id %>/submissions/<%= asset.submission.id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Reminder to Assess: %{rubric}, %{context}", :rubric => asset.rubric_association.title, :context => asset.rubric_association.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "You've been reminded to assess %{rubric}, %{context}:", :rubric => asset.rubric_association.title, :context => asset.rubric_association.context.name %></p>
|
||||
|
||||
<p><strong><%= asset.rubric_association.description %></strong></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "Click here to review the assessment and submit your entry" %></a></p>
|
|
@ -0,0 +1,15 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/rubrics/<%= asset.rubric_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "New Assessment: %{title}, %{context}", :title => asset.title, :context => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "A new assessment has been created for %{context}:", :context => asset.context.name %></p>
|
||||
|
||||
<p><strong><%= asset.title %></strong></p>
|
||||
<p><%= asset.description %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "Click here to review the assessment and submit your entry" %></a></p>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.submission.assignment.context) %>/<%= asset.submission.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.submission.assignment.context_id %>/assignments/<%= asset.submission.assignment_id %>/submissions/<%= asset.submission.user_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Submission Comment: %{user}, %{assignment}, %{context}", :user => asset.submission.user.short_name, :assignment => asset.submission.assignment.title, :context => asset.submission.assignment.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "%{author} just made a new comment on the submission for %{user} for %{assignment}",
|
||||
:author => (asset.author_name || t(:someone, "Someone")),
|
||||
:user => asset.submission.user.short_name,
|
||||
:assignment => asset.submission.assignment.title %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "Click here to review the submission details" %></a></p>
|
|
@ -0,0 +1,14 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.submission.assignment.context) %>/<%= asset.submission.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.submission.assignment.context_id %>/assignments/<%= asset.submission.assignment_id %>/submissions/<%= asset.submission.user_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Submission Comment: %{user}, %{assignment}, %{context}", :user => asset.submission.user.name, :assignment => asset.submission.assignment.title, :context => asset.submission.assignment.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "%{author} just made a new comment on the submission for %{user} for %{assignment}.",
|
||||
:author => (asset.author.name || t(:someone, "Someone")),
|
||||
:user => asset.submission.user.name,
|
||||
:assignment => asset.submission.assignment.title %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "Click here to review the submission details" %></a></p>
|
|
@ -0,0 +1,19 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.assignment.context) %>/<%= asset.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.assignment.context_id %>/assignments/<%= asset.assignment_id %>/submissions/<%= asset.user_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Grade Changed: %{assignment}, %{context}", :assignment => asset.assignment.title, :context => asset.assignment.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "The grade on your assignment, %{assignment_title} has been changed.", :assignment_title => asset.assignment.title %></p>
|
||||
|
||||
<p><%= t :regraded_date, "re-graded: %{date}", :date => (datetime_string(force_zone(asset.graded_at)) rescue t(:no_date_set, "No Date Set")) %></p>
|
||||
|
||||
<% if asset.score && user.try(:send_scores_in_emails?) %>
|
||||
<p><%= t :score, "score: %{score} out of %{total}", :score => asset.score, :total => (asset.assignment.points_possible || t(:not_applicable, "N/A")) %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= t(:score_pending, "score pending review by the teacher") if asset.pending_review? %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "You can review the assignment here" %></a></p>
|
|
@ -0,0 +1,19 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.assignment.context) %>/<%= asset.assignment.context.class.to_s.downcase.pluralize %>/<%= asset.assignment.context_id %>/assignments/<%= asset.assignment_id %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Assignment Graded: %{assignment}, %{context}", :assignment => asset.assignment.title, :context => asset.assignment.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "Your assignment, %{assignment}, has been graded.", :assignment => asset.assignment.title %></p>
|
||||
|
||||
<p><%= t :graded_date, "graded: %{date}", :date => (datetime_string(force_zone(asset.graded_at)) rescue t(:no_date_set, "No Date Set")) %></p>
|
||||
|
||||
<% if asset.score && user.try(:send_scores_in_emails?) %>
|
||||
<p><%= t :score, "score: %{score} out of %{total}", :score => asset.score, :total => (asset.assignment.points_possible || t(:not_applicable, "N/A")) %></p>
|
||||
<% end %>
|
||||
|
||||
<p><%= t(:score_pending_review, "score pending review by the teacher") if asset.pending_review? %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t(:link_message, "You can review the assignment here") %></a></p>
|
|
@ -0,0 +1,45 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(user.pseudonym.try(:account)) %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Recent Canvas Notifications" %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :report_date do %>
|
||||
<%= (date_string(force_zone(m.send_at), :no_words) rescue t("#date.days.today_lower", "today")) %>
|
||||
<% end %>
|
||||
|
||||
<% m = (delayed_messages || []).find{|m| m.frequency == Notification::FREQ_WEEKLY} || delayed_messages.first %>
|
||||
<% if !m || m.frequency == Notification::FREQ_DAILY %>
|
||||
<p><%= t :daily_body, "You're signed up to receive a daily report of some notifications from your Canvas account. Below is the report for %{date}:",
|
||||
:date => content(:report_date) %></p>
|
||||
<% elsif m.frequency == Notification::FREQ_WEEKLY %>
|
||||
<p><%= t :weekly_body, "You're signed up to receive a weekly report of some notifications from your Canvas account. Below is the report for the week ending %{date}:",
|
||||
:date => content(:report_date) %></p>
|
||||
<% end %>
|
||||
|
||||
<% for delayed_message in delayed_messages do %>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><strong><%= delayed_message.name_of_topic %></strong></p>
|
||||
<p><%= delayed_message.formatted_summary %></p>
|
||||
<p><a href="<%= delayed_message.link %>"><%= t :view, "Click to view" %></a></p>
|
||||
<% end %>
|
||||
|
||||
<hr style="border: 0;
|
||||
height: 1px;
|
||||
background: #333;
|
||||
background-image: -webkit-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -moz-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -ms-linear-gradient(left, #ddd, #aaa, #eee);
|
||||
background-image: -o-linear-gradient(left, #ddd, #aaa, #eee);" />
|
||||
|
||||
<p><a href="<%= HostUrl.protocol %>://<%= HostUrl.context_host(user.pseudonym.try(:account)) %>/profile/communication"><%= t 'click_to_preferences', "Click here to edit your notification preferences" %></a></p>
|
|
@ -0,0 +1,15 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context.id %>/wiki/<%= asset.url %>
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Updated Wiki Page: %{title}, %{user}", :title => asset.title.titleize, :user => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "A page has been updated on the wiki for %{title} that may make your life easier.", :title => asset.context.name %></p>
|
||||
|
||||
<p><strong><%= asset.title.titleize %></strong></p>
|
||||
|
||||
<p><%= strip_and_truncate(asset.body, :max_length => 200) %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :link_message, "Click here to review it" %></a></p>
|
|
@ -0,0 +1,11 @@
|
|||
<% define_content :link do %>
|
||||
<%= HostUrl.protocol %>://<%= HostUrl.context_host(asset.context) %>/<%= asset.context.class.to_s.downcase.pluralize %>/<%= asset.context_id %>/conferences
|
||||
<% end %>
|
||||
|
||||
<% define_content :subject do %>
|
||||
<%= t :subject, "Web Conference Invitation: %{name}", :name => asset.context.name %>
|
||||
<% end %>
|
||||
|
||||
<p><%= t :body, "You've been invited to participate in a web conference, %{title} for %{name}.", :title => asset.title, :name => asset.context.name %></p>
|
||||
|
||||
<p><a href="<%= content :link %>"><%= t :details_link, "Click here to see the details", :link => content(:link) %></a></p>
|
|
@ -21,7 +21,9 @@ class DelayedMessage < ActiveRecord::Base
|
|||
belongs_to :notification_policy
|
||||
belongs_to :context, :polymorphic => true
|
||||
belongs_to :communication_channel
|
||||
attr_accessible :notification, :notification_policy, :frequency, :communication_channel, :linked_name, :name_of_topic,:link, :summary, :notification_id, :notification_policy_id, :context_id, :context_type, :communication_channel_id, :context, :workflow_state
|
||||
attr_accessible :notification, :notification_policy, :frequency, :communication_channel, :linked_name, :name_of_topic,
|
||||
:link, :summary, :notification_id, :notification_policy_id, :context_id, :context_type, :communication_channel_id,
|
||||
:context, :workflow_state
|
||||
|
||||
validates_length_of :summary, :maximum => maximum_text_length, :allow_nil => true, :allow_blank => true
|
||||
validates_presence_of :communication_channel_id
|
||||
|
@ -35,7 +37,13 @@ class DelayedMessage < ActiveRecord::Base
|
|||
write_attribute(:summary, val[0,self.class.maximum_text_length])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def formatted_summary
|
||||
(summary || '').
|
||||
gsub(/\n/, "<br />\n").
|
||||
gsub(/(\s\s+)/) { |str| str.gsub(/\s/, ' ') }
|
||||
end
|
||||
|
||||
scope :for, lambda { |context|
|
||||
case context
|
||||
when :daily
|
||||
|
|
|
@ -305,25 +305,17 @@ class Message < ActiveRecord::Base
|
|||
#
|
||||
# Returns a template string (or nil).
|
||||
def load_html_template(_binding)
|
||||
html_file = template_filename('email.html')
|
||||
html_path = Canvas::MessageHelper.find_message_path(html_file)
|
||||
html_file = template_filename('email.html')
|
||||
html_path = Canvas::MessageHelper.find_message_path(html_file)
|
||||
return nil unless File.exist?(html_path)
|
||||
|
||||
if File.exist?(html_path)
|
||||
html_layout do
|
||||
Erubis::Eruby.new(File.read(html_path), :bufvar => '@output_buffer').result(_binding)
|
||||
end
|
||||
end
|
||||
end
|
||||
# Add the attribute 'inner_html' with the value of inner_html into the _binding
|
||||
inner_html = Erubis::Eruby.new(File.read(html_path), :bufvar => '@output_buffer').result(_binding)
|
||||
setter = eval "inner_html = nil; lambda { |v| inner_html = v }", _binding
|
||||
setter.call(inner_html)
|
||||
|
||||
# Public: Return the layout for HTML emails. We need this because
|
||||
# Erubis::Eruby.new.result(binding) doesn't accept a block; by wrapping it
|
||||
# in a method we can pass it a block to handle the <%= yield %> call in the
|
||||
# layout.
|
||||
#
|
||||
# Returns an HTML string.
|
||||
def html_layout
|
||||
layout_path = Canvas::MessageHelper.find_message_path('_layout.email.html.erb')
|
||||
Erubis::Eruby.new(File.read(layout_path)).result(binding)
|
||||
Erubis::Eruby.new(File.read(layout_path)).result(_binding)
|
||||
end
|
||||
|
||||
# Public: Assign the body, subject and url to the message.
|
||||
|
|
|
@ -40,10 +40,37 @@ dd {
|
|||
}
|
||||
}
|
||||
|
||||
.ui-tabs {
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
.message-body {
|
||||
border: 0px;
|
||||
clear: both;
|
||||
margin: 4px 12px;
|
||||
overflow: auto;
|
||||
border: 0px;
|
||||
background-color: white;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.message-html-body {
|
||||
border: 0px;
|
||||
clear: both;
|
||||
overflow: auto;
|
||||
width: 99%;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
table.grid tr:first-child td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.td-label {
|
||||
div {
|
||||
color: #888888;
|
||||
padding-right: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
/*-- workflow state labels --*/
|
||||
|
@ -83,3 +110,10 @@ dd {
|
|||
|
||||
li { display: inline; float: left; margin: 0 16px 0 0; }
|
||||
}
|
||||
|
||||
a.icon-off {
|
||||
font-size: 11px;
|
||||
&:before {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,71 @@
|
|||
<li class="message list-view border border-trbl"
|
||||
data-message-id="<%= message.id %>"
|
||||
data-secure-id="<%= ReplyToAddress.new(message).secure_id %>">
|
||||
<header>
|
||||
<span class="h6"><%= message.subject %></span>
|
||||
data-message-id="<%= message.id %>"
|
||||
data-secure-id="<%= ReplyToAddress.new(message).secure_id %>">
|
||||
<header>
|
||||
<span class="h6"><%= message.subject %></span>
|
||||
|
||||
<span class="label label-<%= message.workflow_state %>">
|
||||
<%= message.workflow_state.capitalize %>
|
||||
</span>
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<dl class="message-meta-data">
|
||||
<dt><%= t('titles.to', 'To') %></dt>
|
||||
<dd class="message-to"><%= message.to %></dd>
|
||||
|
||||
<dt><%= t('titles.from_name', 'From Name') %></dt>
|
||||
<dd class="message-from"><%= message.from_name %></dd>
|
||||
|
||||
<dt><%= t('titles.reply_to', 'Reply to') %></dt>
|
||||
<dd>
|
||||
<span class="message-reply"><%= ReplyToAddress.new(message).address %></span>
|
||||
(<a class="reply-button" href="#" role="button"><%= t('actions.reply', 'Reply') %></a>)
|
||||
</dd>
|
||||
|
||||
<dt><%= t('titles.created_at', 'Created at') %></dt>
|
||||
<dd class="message-created-at"><%= message.created_at %></dd>
|
||||
|
||||
<dt><%= t('titles.sent_at', 'Sent at') %></dt>
|
||||
<dd class="message-sent-at"><%= message.sent_at %></dd>
|
||||
</dl>
|
||||
|
||||
<pre class="message-body well">
|
||||
<%= message.body %>
|
||||
</pre>
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><a href="#meta-data-<%= message.id %>"><%= t('meta_data', 'Meta Data') %></a></li>
|
||||
<li><a href="#tabs-plain-<%= message.id %>"><%= t('plain_text', 'Plain Text') %></a></li>
|
||||
<li><a href="#tabs-plain-html-<%= message.id %>">HTML</a></li>
|
||||
</ul>
|
||||
<div id="meta-data-<%= message.id %>">
|
||||
<table class="table table-condensed grid">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.subject', 'Subject') %></div></td>
|
||||
<td><%= message.subject %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.to', 'To') %></div></td>
|
||||
<td><%= message.to %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.from_name', 'From Name') %></div></td>
|
||||
<td><%= message.from_name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.reply_to', 'Reply to') %></div></td>
|
||||
<td><span class="message-reply"><%= ReplyToAddress.new(message).address %></span>
|
||||
(<a class="reply-button" href="#" role="button"><%= t('actions.reply', 'Reply') %></a>)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.created_at', 'Created at') %></div></td>
|
||||
<td><%= message.created_at %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.sent_at', 'Sent at') %></div></td>
|
||||
<td><%= message.sent_at %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.delay_for', 'Delay for') %></div></td>
|
||||
<td><%= message.delay_for %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.path_type', 'Path type') %></div></td>
|
||||
<td><%= message.path_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="td-label"><div><%= t('titles.notification_name', 'Notification Name') %></div></td>
|
||||
<td><%= message.notification_name %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="tabs-plain-<%= message.id %>">
|
||||
<pre class="message-body"><%= message.body %></pre>
|
||||
</div>
|
||||
<div id="tabs-plain-html-<%= message.id %>">
|
||||
<iframe class="message-html-body" src="<%= user_message_html_message_path(message.user, message) %>"></iframe>
|
||||
<% if message.html_body.present? %>
|
||||
<%= link_to "Open in new window", user_message_html_message_path(message.user, message), :target => "_blank", :class => "icon-off small" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<span style="color: rgb(34, 34, 34); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px;">
|
||||
<%= t :html_not_exist, "The HTML version of this message was not created nor sent" %>
|
||||
</span>
|
|
@ -544,8 +544,13 @@ ActionController::Routing::Routes.draw do |map|
|
|||
user.course_teacher_activity 'teacher_activity/course/:course_id', :controller => 'users', :action => 'teacher_activity'
|
||||
user.student_teacher_activity 'teacher_activity/student/:student_id', :controller => 'users', :action => 'teacher_activity'
|
||||
user.media_download 'media_download', :controller => 'users', :action => 'media_download'
|
||||
user.resources :messages, :only => [:index, :create]
|
||||
user.resources :messages, :only => [:index, :create] do |message|
|
||||
message.html_message "html_message", :controller => "messages", :action => "html_message", :conditions => {:method => :get}
|
||||
end
|
||||
end
|
||||
map.show_message_template 'show_message_template', :controller => 'messages', :action => 'show_message_template'
|
||||
map.message_templates 'message_templates', :controller => 'messages', :action => 'templates'
|
||||
|
||||
map.resource :profile, :only => %w(show update),
|
||||
:controller => "profile",
|
||||
:member => { :update_profile => :put, :communication => :get, :communication_update => :put, :settings => :get } do |profile|
|
||||
|
|
|
@ -29,7 +29,6 @@ def generate_message(notification_name, path_type, asset, options = {})
|
|||
@message.delayed_messages = []
|
||||
@message.parse!(path_type.to_s)
|
||||
@message.body.should_not be_nil
|
||||
# @message.body.should_not be_empty
|
||||
if path_type == :email
|
||||
@message.subject.should_not be_nil
|
||||
@message.url.should_not be_nil
|
||||
|
|
|
@ -32,23 +32,6 @@ describe Message do
|
|||
end
|
||||
|
||||
describe '#populate body' do
|
||||
it 'should generate a body' do
|
||||
HostUrl.stubs(:protocol).returns('https')
|
||||
user = user(:active_all => true)
|
||||
au = AccountUser.create(:account => account_model, :user => user)
|
||||
msg = generate_message(:account_user_notification, :email, au)
|
||||
msg.populate_body('this is a test', 'email', msg.send(:binding))
|
||||
msg.body.should eql('this is a test')
|
||||
end
|
||||
|
||||
it 'should not save an html body by default' do
|
||||
user = user(:active_all => true)
|
||||
account_user = AccountUser.create!(:account => account_model, :user => user)
|
||||
message = generate_message(:account_user_notification, :email, account_user)
|
||||
|
||||
message.html_body.should be_nil
|
||||
end
|
||||
|
||||
it 'should save an html body if a template exists' do
|
||||
Message.any_instance.expects(:load_html_template).returns('template')
|
||||
user = user(:active_all => true)
|
||||
|
@ -65,6 +48,7 @@ describe Message do
|
|||
@au = AccountUser.create(:account => account_model)
|
||||
msg = generate_message(:account_user_notification, :email, @au)
|
||||
msg.body.should include('Account Admin')
|
||||
msg.html_body.should include('Account Admin')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue