Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions apps/api/src/email/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,26 @@ export class EmailService {
},
});

const createdEmails = await Promise.all(
/* const createdEmails = */
await Promise.all(
interns.map((i) => this.createEmailForIntern(i, subject, text)),
);

const template = nunjucks.compile(text);

return Promise.allSettled(
interns.map((intern) => {
const emailId = createdEmails.find(
/*const emailId = createdEmails.find(
(email) => email.internId === intern.id,
).id;

const trackImage = `<img src="https://internship.dump.hr/api/email/logo?emailId=${emailId}" width="1" height="1" style="display:none" />`;
const trackImage = `<img src="https://internship.dump.hr/api/email/logo?emailId=${emailId}" width="1" height="1" style="display:none" />`; */

return this.postmark.sendEmail({
From: 'info@dump.hr',
To: intern.email,
Subject: subject,
HtmlBody: `${template.render({ intern })} ${trackImage}`,
/* HtmlBody: `${template.render({ intern })} ${trackImage}`, */
TextBody: `${template.render({ intern })}`,
MessageStream: 'outbound',
});
}),
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/test-slot/test-slot.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class TestSlotController {
}

@Put(':id')
@UseGuards(AdminGuard)
@UseGuards(MemberGuard)
async updateTestSlot(
@Param('id') testSlotId: string,
@Body() { data }: UpdateTestSlotRequest,
Expand Down