Type Parameters

Hierarchy

  • EmailRouter

Implements

Constructors

Accessors

Methods

Constructors

Properties

Accessors

  • get name(): string
  • Returns string

Methods

  • Matches the given email message against the defined rules and returns the first matching rule.

    Parameters

    Returns Promise<null | EmailRouteRule>

    The first matching rule or null if no rule matches the message.

  • Parameters

    • ctx: In
    • Optional next: ((c) => Promise<void>)
        • (c): Promise<void>
        • Parameters

          • c: In

          Returns Promise<void>

    Returns Promise<void>

  • Adds a new route rule to the router's list of rules. The first added rule will be checked first.

    Parameters

    Returns EmailRouter<In>

    The router itself.

  • Parameters

    Returns EmailRouter<In>

  • Processes the email message and returns the result of the matching route handle.

    Parameters

    • ctx: In

      The email context object.

    • Optional next: ((c) => Promise<void>)

      The next middleware function.

        • (c): Promise<void>
        • Parameters

          • c: In

          Returns Promise<void>

    Returns Promise<EmailRouteHandleResult>

    An object containing the matched route handle or null if no match was found.

Generated using TypeDoc