-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add rejection-email template and email generator method * add javadoc for email generator method * add test * fix test method names * fix test method name 2 * fix lint * add bcc for rejection email
- Loading branch information
1 parent
62750b0
commit 96e5abd
Showing
4 changed files
with
51 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
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 |
---|---|---|
|
@@ -62,6 +62,33 @@ void testGenerateNewAccountRequestAcknowledgementEmail_withNoComments_generatesS | |
"/instructorNewAccountRequestAcknowledgementEmailWithNoComments.html"); | ||
} | ||
|
||
@Test | ||
void testGenerateAccountRequestRejectionEmail_withDefaultReason_generatesSuccessfully() throws IOException { | ||
AccountRequest accountRequest = new AccountRequest("[email protected]", "Maul", "Sith Order", | ||
AccountRequestStatus.PENDING, null); | ||
String title = "We are Unable to Create an Account for you"; | ||
String content = new StringBuilder() | ||
.append("<p>Hi, Maul</p>\n") | ||
.append("<p>Thanks for your interest in using TEAMMATES. ") | ||
.append("We are unable to create a TEAMMATES instructor account for you.</p>\n\n") | ||
.append("<p>\n") | ||
.append(" <strong>Reason:</strong> The email address you provided ") | ||
.append("is not an 'official' email address provided by your institution.<br />\n") | ||
.append(" <strong>Remedy:</strong> ") | ||
.append("Please re-submit an account request with your 'official' institution email address.\n") | ||
.append("</p>\n\n") | ||
.append("<p>If you need further clarification or would like to appeal this decision, ") | ||
.append("please feel free to contact us at [email protected].</p>\n") | ||
.append("<p>Regards,<br />TEAMMATES Team.</p>\n") | ||
.toString(); | ||
|
||
EmailWrapper email = sqlEmailGenerator.generateAccountRequestRejectionEmail(accountRequest, title, content); | ||
verifyEmail(email, "[email protected]", EmailType.ACCOUNT_REQUEST_REJECTION, | ||
"TEAMMATES: " + title, | ||
Config.SUPPORT_EMAIL, | ||
"/instructorAccountRequestRejectionEmail.html"); | ||
} | ||
|
||
private void verifyEmail(EmailWrapper email, String expectedRecipientEmailAddress, EmailType expectedEmailType, | ||
String expectedSubject, String expectedEmailContentFilePathname) throws IOException { | ||
assertEquals(expectedRecipientEmailAddress, email.getRecipient()); | ||
|
10 changes: 10 additions & 0 deletions
10
src/test/resources/emails/instructorAccountRequestRejectionEmail.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,10 @@ | ||
<p>Hi, Maul</p> | ||
<p>Thanks for your interest in using TEAMMATES. We are unable to create a TEAMMATES instructor account for you.</p> | ||
|
||
<p> | ||
<strong>Reason:</strong> The email address you provided is not an 'official' email address provided by your institution.<br /> | ||
<strong>Remedy:</strong> Please re-submit an account request with your 'official' institution email address. | ||
</p> | ||
|
||
<p>If you need further clarification or would like to appeal this decision, please feel free to contact us at teammates@comp.nus.edu.sg.</p> | ||
<p>Regards,<br />TEAMMATES Team.</p> |