This repository has been archived by the owner on May 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sending email and minting ARKs when records are completed
- Loading branch information
Showing
16 changed files
with
151 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,4 @@ gem 'posix-spawn' | |
gem 'openseadragon' | ||
gem 'sidekiq' | ||
gem "omniauth-cas" | ||
gem 'ezid-client' |
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,4 @@ | ||
class ApplicationMailer < ActionMailer::Base | ||
default from: Plum.config[:email][:from_address] | ||
layout 'mailer' | ||
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,6 @@ | ||
class ReviewerMailer < ApplicationMailer | ||
def completion_email(curation_concern) | ||
@curation_concern = curation_concern | ||
mail(to: Plum.config[:email][:reviewer_address], subject: "[plum] #{@curation_concern.human_readable_type} #{@curation_concern.id} is complete") | ||
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
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 @@ | ||
<html> | ||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
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 @@ | ||
<%= yield %> |
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,17 @@ | ||
<p>The following <%= @curation_concern.human_readable_type %> has been marked complete:</p> | ||
|
||
<table> | ||
<tr> | ||
<th>ID</th> | ||
<td><%= @curation_concern.id %></td> | ||
</tr> | ||
<tr> | ||
<th>Title</th> | ||
<td><%= @curation_concern.title.first %></td> | ||
</tr> | ||
<tr> | ||
<th>URL</th> | ||
<% url = polymorphic_url [main_app, :curation_concerns, @curation_concern] %> | ||
<td><%= link_to url, url %></td> | ||
</tr> | ||
</table> |
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 @@ | ||
The following <%= @curation_concern.human_readable_type %> has been marked complete: | ||
|
||
ID...: <%= @curation_concern.id %> | ||
Title: <%= @curation_concern.title.first %> | ||
URL..: <%= polymorphic_url([main_app, :curation_concerns, @curation_concern]) %> |
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 @@ | ||
Ezid::Client.configure do |conf| | ||
conf.default_shoulder = 'ark:/99999/fk4' unless ENV['EZID_DEFAULT_SHOULDER'] | ||
conf.user = 'apitest' unless ENV['EZID_USER'] | ||
conf.password = 'apitest' unless ENV['EZID_PASSWORD'] | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,18 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe ReviewerMailer, type: :mailer do | ||
describe '#completion_email' do | ||
let(:curation_concern) { FactoryGirl.create(:scanned_resource) } | ||
before(:each) do | ||
ActionMailer::Base.deliveries = [] | ||
described_class.completion_email(curation_concern).deliver_now | ||
end | ||
|
||
it 'sends an email' do | ||
expect(ActionMailer::Base.deliveries.count).to eq 1 | ||
expect(ActionMailer::Base.deliveries.first.from).to eq ['plum@princeton.edu'] | ||
expect(ActionMailer::Base.deliveries.first.to).to eq [Plum.config[:email][:reviewer_address]] | ||
expect(ActionMailer::Base.deliveries.first.subject).to eq "[plum] #{curation_concern.human_readable_type} #{curation_concern.id} is complete" | ||
end | ||
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