Add Tickets domain for the voucher-based ticket shop (#8)
Jenkins Production Deployment

Reviewed-on: #8
Co-authored-by: Patrick Mueller <patrick@mueller-patrick.tech>
Co-committed-by: Patrick Mueller <patrick@mueller-patrick.tech>
This commit was merged in pull request #8.
This commit is contained in:
2026-08-24 21:18:00 +00:00
committed by Patrick Müller
parent b05f6b9da0
commit 3c4f3331d8
30 changed files with 2598 additions and 24 deletions
+24 -20
View File
@@ -13,26 +13,30 @@ export namespace MailService {
tls: {rejectUnauthorized: false}
});
const mailConfigurations = {
export interface MailAttachment {
filename: string;
content: string | Buffer;
contentType?: string;
}
// It should be a string of sender email
from: 'noreply@nachklang.art',
export interface SendMailOptions {
html?: string;
attachments?: MailAttachment[];
}
// Comma Separated list of mails
to: 'mail@pmueller.me',
// Subject of Email
subject: '',
// This would be the text of email body
text: ''
// Builds a fresh options object per call rather than mutating a shared
// module-level one - the transporter is pooled, so overlapping sendMail
// calls (e.g. two guests redeeming at once) previously risked one
// call's recipient/subject/body being overwritten by another's before
// transporter.sendMail() read it.
export const sendMail = async (recipientAddress: string, subject: string, body: string, options?: SendMailOptions) => {
await transporter.sendMail({
from: 'noreply@nachklang.art',
to: recipientAddress,
subject: subject,
text: body,
html: options?.html,
attachments: options?.attachments
});
};
export const sendMail = async (recipientAddress: string, subject: string, body: string) => {
mailConfigurations.to = recipientAddress;
mailConfigurations.subject = subject;
mailConfigurations.text = body;
await transporter.sendMail(mailConfigurations);
};
}
}