-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add stuck submissions to mailer (#3785)
* Add stuck submissions to mailer move views to proper location refactor table into partial * Line too long
- Loading branch information
Showing
6 changed files
with
32 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 |
---|---|---|
|
@@ -13,12 +13,19 @@ class UnsuccessfulReportMailer < ApplicationMailer | |
[email protected] | ||
].freeze | ||
|
||
def build(unsuccessful_submissions, date_from, date_to) | ||
def build(unsuccessful_submissions, stuck_submissions, date_from, date_to) | ||
@unsuccessful_submissions = unsuccessful_submissions | ||
@stuck_submissions = stuck_submissions | ||
@date_from = date_from | ||
@date_to = date_to | ||
|
||
path = VBADocuments::Engine.root.join('app', 'mailers', 'vba_documents', 'views', 'unsuccessful_report.erb') | ||
path = VBADocuments::Engine.root.join( | ||
'app', | ||
'views', | ||
'vba_documents', | ||
'unsuccessful_report_mailer', | ||
'unsuccessful_report.html.erb' | ||
) | ||
template = File.read(path) | ||
|
||
mail( | ||
|
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
10 changes: 10 additions & 0 deletions
10
...documents/app/views/vba_documents/unsuccessful_report_mailer/unsuccessful_report.html.erb
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,10 @@ | ||
<h1>Unsuccessful Submissions <%= 'Summary' if @date_to.monday? %> </h1> | ||
<hr /> | ||
<h3>From <%= @date_from %> -- <%= @date_to %> </h3> | ||
<h4> Unsuccessful count: <%= @unsuccessful_submissions.count %> | ||
<%= render partial: 'submission_table', locals: {submissions: @unsuccessful_submissions } %> | ||
|
||
<hr> | ||
|
||
<h4> Stuck Submissions Count: <%= @stuck_submissions.count %> | ||
<%= render partial: 'submission_table', locals: {submissions: @stuck_submissions} unless @stuck_submissions.count.zero? %> |
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