Skip to content

Commit 5d7f19a

Browse files
committed
refactor: simplify code and change ticket "Siège" -> "Place"
1 parent 91cff70 commit 5d7f19a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/services/email/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ export const sendMailsFromTemplate = async (template: string, targets: any[]) =>
138138
if (targets.length > 1) {
139139
const outgoingMails = await Promise.allSettled(
140140
targets.map(async (target) => {
141-
const mail = await mailTemplate(target);
142-
await sendEmail(mail);
141+
await sendEmail(await mailTemplate(target));
143142
}),
144143
);
145144

@@ -163,8 +162,7 @@ export const sendMailsFromTemplate = async (template: string, targets: any[]) =>
163162
console.info(`\tMails envoyés: ${results.delivered}\n\tMails non envoyés: ${results.undelivered}`);
164163
return results;
165164
}
166-
const mail = await mailTemplate(targets[0]);
167-
return sendEmail(mail);
165+
return sendEmail(await mailTemplate(targets[0]));
168166
} catch (error) {
169167
logger.error('Error while sending emails', error);
170168
return false;

src/utils/ticket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const generateTicket = async (cartItem: DetailedCartItem): Promise<EmailA
7676

7777
// Place the text containing the seat
7878
if (user.place) {
79-
const place = `Siège ${user.place}`;
79+
const place = `Place ${user.place}`;
8080
const placeWidth = document.widthOfString(place);
8181
textFormat.text(place, textX - placeWidth / 2, height - fontSize - lineSpaceCorrection * 4);
8282
}

0 commit comments

Comments
 (0)