-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/email on submission approval (#1255)
* approve add dialog * approval function * set submission doc approval properties * init WIP todo generate approval mail function in implementation * reference * Add submission_accepted email template and mail generator * Set submission accept generator in mail notification implementation * typo * note
- Loading branch information
Showing
12 changed files
with
354 additions
and
38 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
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
1 change: 1 addition & 0 deletions
1
...2-couch-sdk/src/main/content/docs/org.nunaliit.email_template.submission_accepted/_id.txt
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 @@ | ||
org.nunaliit.email_template.submission_accepted |
12 changes: 12 additions & 0 deletions
12
...ent/docs/org.nunaliit.email_template.submission_accepted/nunaliit_email_template/body.txt
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 @@ | ||
<html> | ||
<head> | ||
<title>Submission Approved</title> | ||
</head> | ||
<body> | ||
<h1>Submission Approved</h1> | ||
<p>Your submission was approved and is now available in the atlas.</p> | ||
{{#approvalMessage}} | ||
<p>{{approvalMessage}}</p> | ||
{{/approvalMessage}} | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
.../docs/org.nunaliit.email_template.submission_accepted/nunaliit_email_template/subject.txt
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 @@ | ||
Submission Approved - {{#submissionDocId}}{{.}}{{/submissionDocId}}{{^submissionDocId}}<unknown>{{/submissionDocId}} |
1 change: 1 addition & 0 deletions
1
...src/main/content/docs/org.nunaliit.email_template.submission_accepted/nunaliit_schema.txt
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 @@ | ||
email_template |
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
37 changes: 37 additions & 0 deletions
37
...ion/src/main/java/ca/carleton/gcrc/couch/submission/mail/SubmissionAcceptedGenerator.java
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,37 @@ | ||
package ca.carleton.gcrc.couch.submission.mail; | ||
|
||
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
import java.util.Map; | ||
|
||
import ca.carleton.gcrc.mail.MailMessage; | ||
import ca.carleton.gcrc.mail.messageGenerator.MailMessageGenerator; | ||
|
||
public class SubmissionAcceptedGenerator implements MailMessageGenerator { | ||
|
||
@Override | ||
public void generateMessage( | ||
MailMessage message, | ||
Map<String, String> parameters) throws Exception { | ||
|
||
String submissionDocId = parameters.get("submissionDocId"); | ||
String approvalMessage = parameters.get("approvalMessage"); | ||
|
||
if (null == submissionDocId) { | ||
message.setSubject("Submission Approved - <unknown>"); | ||
} else { | ||
message.setSubject("Submission Approved - " + submissionDocId); | ||
} | ||
|
||
StringWriter sw = new StringWriter(); | ||
PrintWriter pw = new PrintWriter(sw); | ||
pw.println("<html><head><title>Submission Approved</title></head><body><h1>Submission Approved</h1>"); | ||
pw.println("<p>Your submission was approved and is now available in the atlas.</p>"); | ||
if (null != approvalMessage) { | ||
pw.println("<p>" + approvalMessage + "</p>"); | ||
} | ||
pw.println("</body></html>"); | ||
pw.flush(); | ||
message.setHtmlContent(sw.toString()); | ||
} | ||
} |
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
Oops, something went wrong.