-
-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: email service for productivity report
- Loading branch information
Showing
5 changed files
with
416 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -143,3 +143,29 @@ test('Can send order environments email', async () => { | |
expect(content.html.includes(customerId)).toBe(true); | ||
expect(content.bcc).toBe('[email protected]'); | ||
}); | ||
|
||
test('Can send productivity report email', async () => { | ||
const emailService = new EmailService({ | ||
email: { | ||
host: 'test', | ||
port: 587, | ||
secure: false, | ||
smtpuser: '', | ||
smtppass: '', | ||
sender: '[email protected]', | ||
}, | ||
getLogger: noLoggerProvider, | ||
} as unknown as IUnleashConfig); | ||
|
||
const customerId = 'customer133'; | ||
|
||
const content = await emailService.sendProductivityReportEmail( | ||
'[email protected]', | ||
customerId, | ||
); | ||
expect(content.from).toBe('[email protected]'); | ||
expect(content.subject).toBe('Unleash - productivity report'); | ||
expect( | ||
content.html.includes(`<b>Productivity report for customer133</b>`), | ||
).toBe(true); | ||
}); |
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
Oops, something went wrong.