SudoSOS Back-end API / internal/mailer / Mailer
Class: Mailer ​
Constructors ​
Constructor ​
ts
new Mailer(redisConnection?): Mailer;Create a Mailer instance.
When a Redis connection is provided, emails are queued via BullMQ (production behaviour). When no connection is provided the Mailer falls back to sending emails directly through the SMTP transporter – useful for local development where Redis may not be running.
Parameters ​
| Parameter | Type |
|---|---|
redisConnection? | Redis |
Returns ​
Mailer
Methods ​
send() ​
ts
send<T>(
to,
template,
language?,
extraOptions?): Promise<void>;Type Parameters ​
| Type Parameter |
|---|
T |
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
to | User | undefined |
template | MailMessage<T> | undefined |
language | Language | Language.ENGLISH |
extraOptions? | Options | undefined |
Returns ​
Promise<void>
getInstance() ​
ts
static getInstance(): Mailer;Returns ​
Mailer
reset() ​
ts
static reset(): void;TEST-ONLY FUNCTION to reset the singleton. This is required in all test suites that use this object to make sure they have the correct stubs
Returns ​
void