-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4256 from tulibraries/BL-1834-Send-To-Email_templ…
…ate_accessibility BL-1834 Send To Email template accessibility
- Loading branch information
Showing
5 changed files
with
68 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
module RecordMailerHelper | ||
def record_mailer_link(document, url_gen_params) | ||
url = polymorphic_url(document, @url_gen_params) | ||
link_to(url, url) | ||
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,12 @@ | ||
<h1>Temple University Libraries record(s):</h1> | ||
|
||
<p> | ||
<%= t('blacklight.email.text.message', :message => @message) %> | ||
</p> | ||
|
||
<% @documents.each do |document| %> | ||
<%= document.to_email_text %><br> | ||
<%= t('blacklight.email.html.url') %> | ||
<%= record_mailer_link(document, @url_gen_params) %> | ||
<br> | ||
<% end %> |
This file was deleted.
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,46 @@ | ||
# frozen_string_literal: true | ||
|
||
# Preview all emails at http://localhost:3000/rails/mailers/record_mailer.rb | ||
class RecordMailerPreview < ActionMailer::Preview | ||
def record_email | ||
RecordMailer.email_record(documents, details, url) | ||
end | ||
|
||
def details | ||
{ | ||
message: "Hello World", | ||
config: PrimoCentralController.new.blacklight_config | ||
} | ||
end | ||
|
||
def url | ||
{ host: "localhost", | ||
port: 3000, | ||
protocol: "http://" } | ||
end | ||
|
||
def documents | ||
[ document ] | ||
end | ||
|
||
def document | ||
PrimoCentralDocument.new( | ||
|
||
{ | ||
"pnxId" => "example_1234567890", | ||
"title" => "Be Excellent", | ||
"issn" => [ | ||
"8769-3369", | ||
"0069-0069" | ||
], | ||
"isPartOf" => "Transactions of the Timetravel, 2024-02, Vol.33, p.69", | ||
"creator" => [ | ||
"Preston, Bill S.", | ||
"Logan, Ted 'Theodore'", | ||
], | ||
"date" => [ | ||
"1989" | ||
], | ||
}) | ||
end | ||
end |