MailService

Source: MailService.js:16

Service for sending emails and managing mail operations. Handles email composition, sending, and related logic.


Constructor

new MailService(): MailService

Instance Methods

sendUserRegistrationNotice( username: string, userId: UUID, userEmail: string, ): Promise.<Array.<void>>

Sends a notice to admin emails about a new user registration.

Parameters

  • username (string) — The username of the new user.
  • userId (UUID) — The ID of the new user.
  • userEmail (string) — The email of the new user.

Returns

  • Promise.<Array.<void>> — Resolves when all emails are sent.

sendWelcomeEmail( username: string, userId: UUID, userEmail: string, locale: string, ): Promise.<void>

Sends a welcome email to a new user.

Parameters

  • username (string) — The username of the new user.
  • userId (UUID) — The ID of the new user.
  • userEmail (string) — The email of the new user.
  • locale (string) — The locale for the email content.

Returns

  • Promise.<void> — Resolves when the email is sent.

sendEmailConfirmationEmail( username: string, userId: UUID, userEmail: string, locale: string, ): Promise.<void>

Sends an email confirmation request to a user.

Parameters

  • username (string) — The username of the user.
  • userId (UUID) — The ID of the user.
  • userEmail (string) — The email of the user.
  • locale (string) — The locale for the email content.

Returns

  • Promise.<void> — Resolves when the email is sent.

sendFeedbackNotice( username: string, userEmail: string, stars: number, text: string, ): Promise.<Array.<void>>

Sends a feedback notice to admin emails.

Parameters

  • username (string) — The username of the user providing feedback.
  • userEmail (string) — The email of the user providing feedback.
  • stars (number) — The rating provided by the user.
  • text (string) — The feedback text provided by the user.

Returns

  • Promise.<Array.<void>> — Resolves when all emails are sent.

sendSsoEmail( userEmail: string, username: string, ssoToken: string, locale: string, ): Promise.<void>

Sends an SSO login email to a user.

Parameters

  • userEmail (string) — The email of the user.
  • username (string) — The username of the user.
  • ssoToken (string) — The SSO token for login.
  • locale (string) — The locale for the email content.

Returns

  • Promise.<void> — Resolves when the email is sent.

sendNotificationNotice( userEmail: string, username: string, ssoToken: string, notificationTitle: string | null, locale: string, ): Promise.<void>

Sends a notification email to a user.

Parameters

  • userEmail (string) — The email of the user.
  • username (string) — The username of the user.
  • ssoToken (string) — The SSO token for login.
  • notificationTitle (string | null, default: null) — The title of the notification.
  • locale (string) — The locale for the email content.

Returns

  • Promise.<void> — Resolves when the email is sent.

sendContactMessage( name: string, email: string, subject: string, message: string, category: string, user: User | null, locale: string, ): Promise.<void>

Sends a contact message email to the support team.

Parameters

  • name (string) — The name of the sender.
  • email (string) — The email of the sender.
  • subject (string) — The subject of the message.
  • message (string) — The content of the message.
  • category (string) — The category of the message (e.g., "bug", "feedback", "other").
  • user (User | null) — The user object if the sender is logged in, otherwise null.
  • locale (string) — The locale for the email content.

Returns

  • Promise.<void> — Resolves when the email is sent.

sendContactNotification( name: string, email: string, subject: string, message: string, category: string, locale: string, ): Promise.<void>

Sends a contact message email to the user.

Parameters

  • name (string) — The name of the sender.
  • email (string) — The email of the sender.
  • subject (string) — The subject of the message.
  • message (string) — The content of the message.
  • category (string) — The category of the message (e.g., "bug", "feedback", "other").
  • locale (string) — The locale for the email content.

Returns

  • Promise.<void> — Resolves when the email is sent.