mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 17:59:25 +00:00
Don't block main thread waiting for email to build and send
This commit is contained in:
@@ -114,16 +114,16 @@ class TestResult {
|
||||
`(${this.percentage}%) which is a grade ` +
|
||||
`${this.grade}`;
|
||||
|
||||
const parents = await this.student.getParents();
|
||||
this.student.getParents().then(parents => {
|
||||
const email = new EmailBuilder()
|
||||
.addTo([ this.student, ...parents ]
|
||||
.map(u => u.getEmail()))
|
||||
.setSubject('Stratos - Test result changed')
|
||||
.setBody(body);
|
||||
|
||||
const email = new EmailBuilder()
|
||||
.addTo([ this.student, ...parents ]
|
||||
.map(u => u.getEmail()))
|
||||
.setSubject('Stratos - Test result changed')
|
||||
.setBody(body);
|
||||
|
||||
const emailer = new Emailer();
|
||||
await emailer.sendEmail(email);
|
||||
const emailer = new Emailer();
|
||||
emailer.sendEmail(email);
|
||||
});
|
||||
}
|
||||
|
||||
get percentage() {
|
||||
|
||||
Reference in New Issue
Block a user