Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/send ticket #265

Merged
merged 18 commits into from
Nov 27, 2024
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
Loading