Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added email confirmation and notification after transfer.
- Loading branch information
Showing
8 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class UserMailer < ActionMailer::Base | ||
default :from => Drxfer::Application.config.email_notification_from_address | ||
|
||
def transfer_confirmation(transfer) | ||
@transfer = transfer | ||
mail(:to => transfer.user.email, | ||
:subject => "Thank you for transferring your digital records") | ||
end | ||
|
||
def transfer_notification(transfer) | ||
@transfer = transfer | ||
mail(:to => Drxfer::Application.config.transfer_notification_recipient_addresses, | ||
:subject => "A digital records transfer has been received") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Dear <%= @transfer.user.first_name %>, | ||
|
||
Thank you for transferring your digital records. | ||
|
||
We have received the following file<%= @transfer.attachments.size == 1 ? '' : 's' %>: | ||
<% @transfer.attachments.each do |attachment| %> | ||
<%= File.basename(attachment.asset.current_path) %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Dear Transfer Recipient, | ||
|
||
<%= @transfer.user.full_name %> has made a digital records transfer. | ||
|
||
Transfer agreement: | ||
<%= @transfer.agreement.name %> | ||
|
||
Path to destination folder: | ||
<%= @transfer.agreement.folder.full_path %> | ||
|
||
Transfer description: | ||
<%= @transfer.description %> | ||
|
||
Transferred file<%= @transfer.attachments.size == 1 ? '' : 's' %>: | ||
<% @transfer.attachments.each do |attachment| %> | ||
<%= File.basename(attachment.asset.current_path) %> | ||
Content-type: <%= attachment.content_type %> | ||
Size: <%= number_to_human_size(attachment.file_size) %> | ||
MD5: <%= attachment.md5 %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "spec_helper" | ||
|
||
describe UserMailer do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |