Skip to content

Commit

Permalink
Feat/send ticket (#265)
Browse files Browse the repository at this point in the history
* feat: new email system

* feat: add General Mail route

* feat: back to street legal

* feat: add sendTemplate

* fix: it's better with .fr

* fix: update email template topics

* fix: add return and fix preview undefined

* fix: change minor mail target

* fix: lint

* fix: lint2

* test: disable mail tests

* test: disable other mail test

* feat: mail smtp

* Update .env.example

* Update notPaid.ts

* Update env.ts

---------

Co-authored-by: Noé Landré <[email protected]>
Co-authored-by: Arthur Dodin <[email protected]>
Co-authored-by: Antoine D <[email protected]>
  • Loading branch information
4 people authored Nov 27, 2024
1 parent a1661e5 commit 8205977
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ EMAIL_PORT=
EMAIL_SECURE=
EMAIL_SENDER_NAME=
EMAIL_SENDER_ADDRESS=
EMAIL_AUTH_USER=
EMAIL_AUTH_PASSWORD=
EMAIL_REJECT_UNAUTHORIZED=

# Used to give a discount on tickets
Expand Down
7 changes: 2 additions & 5 deletions src/services/email/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ const emailOptions = {
host: env.email.host,
port: env.email.port,
secure: env.email.secure,
auth: {
user: env.email.auth.user,
pass: env.email.auth.password,
},
tls: {
rejectUnauthorized: env.email.rejectUnauthorized,
},
Expand Down Expand Up @@ -117,8 +113,9 @@ export const sendEmail = async (mail: SerializedMail, attachments?: EmailAttache
});

logger.info(`Email sent to ${mail.to}`);
} catch {
} catch (error) {
logger.warn(`Could not send email to ${mail.to}`);
logger.error(error);
}
};

Expand Down
4 changes: 0 additions & 4 deletions src/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ const env = {
name: loadEnv('EMAIL_SENDER_NAME') || 'UTT Arena',
address: loadEnv('EMAIL_SENDER_ADDRESS') || '[email protected]',
},
auth: {
user: loadEnv('EMAIL_AUTH_USER'),
password: loadEnv('EMAIL_AUTH_PASSWORD'),
},
rejectUnauthorized: loadEnv('EMAIL_REJECT_UNAUTHORIZED') !== 'false',
maxMailsPerBatch: loadIntEnv('MAX_MAIL_PER_BATCH') || 100,
partners: loadEnv('PARTNER_MAILS')?.split(',') || [],
Expand Down

0 comments on commit 8205977

Please sign in to comment.