@cfxlabsinc/b2b-services
    Preparing search index...

    Type Alias EmailNotification

    EmailNotification:
        | {
            achName?: string;
            customerName: string;
            depositUrl: string;
            id: string;
            name: string;
            status: | "PENDING_VERIFICATION"
            | "ACTION_REQUIRED"
            | "APPROVED"
            | "REVIEW"
            | "DISABLED"
            | "BLOCKED"
            | "DELETED";
            supportUrl: string;
            template: "IDENTITY";
            url: string;
            wireName?: string;
        }
        | {
            achName?: string;
            customerName: string;
            depositUrl: string;
            id: string;
            name: string;
            status: | "PENDING_VERIFICATION"
            | "ACTION_REQUIRED"
            | "APPROVED"
            | "DISABLED";
            supportUrl: string;
            template: "ORGANIZATION";
            url: string;
            wireName?: string;
        }
        | {
            customerName: string;
            id: string;
            name: string;
            supportUrl: string;
            template: "LEDGER_ACCOUNT";
            url: string;
        }
        | {
            customerName: string;
            id: string;
            missingDetails?: string;
            name: string;
            paymentUrl: string;
            status: | "PENDING_VERIFICATION"
            | "ACTION_REQUIRED"
            | "APPROVED"
            | "BLOCKED";
            supportUrl: string;
            template: "PAYMENT_INSTRUMENT";
            type: "SWIFT_WIRE"
            | "US_ACH"
            | "US_WIRE"
            | "WALLET";
            url: string;
        }
        | {
            account: string;
            accountUrl: string;
            amount: string;
            customerName: string;
            date?: string;
            entityName: string;
            id: string;
            imad?: string;
            memo?: string;
            omad?: string;
            reference?: string;
            senderName?: string;
            status: "PENDING"
            | "DEPOSITED"
            | "CANCELLED";
            supportUrl: string;
            template: "DEPOSIT";
            type: "DIRECT" | "US_BANK_ACH" | "US_WIRE" | "SWIFT_WIRE";
            url: string;
        }
        | {
            account: string;
            accountUrl: string;
            achName?: string;
            amount: string;
            customerName: string;
            entityName: string;
            id: string;
            imad?: string;
            omad?: string;
            paymentInstrumentName: string;
            status: "PENDING"
            | "COMPLETED"
            | "RETURNED";
            supportUrl: string;
            template: "WITHDRAW";
            type: "SWIFT_WIRE" | "ACH_CREDIT" | "US_WIRE" | "BLOCKCHAIN";
            url: string;
            wireName?: string;
        }
        | {
            amount: string;
            customerName: string;
            id: string;
            senderMessage?: string;
            sourceAccount: string;
            sourceAccountUrl: string;
            sourceCustomerName?: string;
            status: "PENDING"
            | "CANCELLED"
            | "SUCCEEDED";
            supportUrl: string;
            targetAccount: string;
            targetAccountUrl: string;
            targetCustomerName?: string;
            template: "TRANSFER";
            type: "INTERNAL" | "NETWORK_SENDER" | "NETWORK_RECEIVER";
            url: string;
        }
        | {
            amount: string;
            card: string;
            id: string;
            merchantName: string;
            reason?: string;
            status: "PENDING"
            | "DECLINED"
            | "AUTHORIZED"
            | "COMPLETED";
            supportUrl: string;
            template: "CARD_TRANSACTION";
            type: "AUTHORIZATION" | "REVERSAL";
            url: string;
        }
        | {
            amount: string;
            currency: string;
            customerName: string;
            debitDate: string;
            id: string;
            invoiceNumber: string;
            issuedDate: string;
            periodLabel: string;
            sourceAccountName: string;
            supportUrl: string;
            template: "INVOICE";
        }
        | {
            amount: string;
            currency: string;
            customerName: string;
            feeTransferId: string;
            id: string;
            invoiceNumber: string;
            paidAt: string;
            periodLabel: string;
            sourceAccountName: string;
            supportUrl: string;
            template: "RECEIPT";
            transactionSignature: string;
        }
        | {
            code: string;
            email: string;
            status: | "SIGN_UP"
            | "RESEND_CODE"
            | "FORGOT_PASSWORD"
            | "UPDATE_USER_ATTRIBUTE"
            | "VERIFY_USER_ATTRIBUTE"
            | "ADMIN_CREATE_USER"
            | "AUTHENTICATION";
            supportUrl: string;
            template: "AUTH";
        }
        | {
            email: string;
            status: "ACCOUNT_TAKE_OVER_NOTIFICATION";
            supportUrl: string;
            template: "AUTH";
        }
        | {
            id: string;
            name: string;
            status: "SUBMITTED"
            | "INFO_REQUESTED"
            | "DECLINED"
            | "APPROVED";
            supportUrl: string;
            template: "APPLICATION";
            url: string;
        }

    The email notification payload union: one member per code-registered template key, carrying the merge variables that key's copy may interpolate.

    This is the shape the event-driven sender builds each notification from — the lambda resolves recipients through CustomerNotificationService and renders these payloads through its b2b.email_template templates.

    Hoisted out of send so the email template registry can derive its condition vocabulary from it (see ./schema/email_template.ts) without a circular type alias — the registry's key type comes from this union, and the sender's signature comes from the registry.

    Lives in db rather than notification-services because the registry it feeds sits next to the b2b.email_template tables it seeds, and those tables' templateKey / statusVariant columns are typed from it. Pure types, so notification-services re-exports them from here at no runtime cost and the eleven sending services import the same names as before.

    A template can only interpolate variables a sending app actually provides, so this union is the authority on the vocabulary. Adding a merge variable is a change here plus a change in every sending app that builds that member.

    Type Declaration

    • {
          achName?: string;
          customerName: string;
          depositUrl: string;
          id: string;
          name: string;
          status:
              | "PENDING_VERIFICATION"
              | "ACTION_REQUIRED"
              | "APPROVED"
              | "REVIEW"
              | "DISABLED"
              | "BLOCKED"
              | "DELETED";
          supportUrl: string;
          template: "IDENTITY";
          url: string;
          wireName?: string;
      }
      • OptionalachName?: string

        The entity's own beneficiary names, as they appear on an INCOMING payment (docs/BENEFICIARY_NAMES.md). Optional because the producer may predate them; copy that uses one must guard it.

      • customerName: string
      • depositUrl: string
      • id: string
      • name: string
      • status:
            | "PENDING_VERIFICATION"
            | "ACTION_REQUIRED"
            | "APPROVED"
            | "REVIEW"
            | "DISABLED"
            | "BLOCKED"
            | "DELETED"
      • supportUrl: string
      • template: "IDENTITY"
      • url: string
      • OptionalwireName?: string
    • {
          achName?: string;
          customerName: string;
          depositUrl: string;
          id: string;
          name: string;
          status:
              | "PENDING_VERIFICATION"
              | "ACTION_REQUIRED"
              | "APPROVED"
              | "DISABLED";
          supportUrl: string;
          template: "ORGANIZATION";
          url: string;
          wireName?: string;
      }
      • OptionalachName?: string

        The entity's own beneficiary names, as they appear on an INCOMING payment (docs/BENEFICIARY_NAMES.md). Optional because the producer may predate them; copy that uses one must guard it.

      • customerName: string
      • depositUrl: string
      • id: string
      • name: string
      • status: "PENDING_VERIFICATION" | "ACTION_REQUIRED" | "APPROVED" | "DISABLED"
      • supportUrl: string
      • template: "ORGANIZATION"
      • url: string
      • OptionalwireName?: string
    • {
          customerName: string;
          id: string;
          name: string;
          supportUrl: string;
          template: "LEDGER_ACCOUNT";
          url: string;
      }
    • {
          customerName: string;
          id: string;
          missingDetails?: string;
          name: string;
          paymentUrl: string;
          status: "PENDING_VERIFICATION" | "ACTION_REQUIRED" | "APPROVED" | "BLOCKED";
          supportUrl: string;
          template: "PAYMENT_INSTRUMENT";
          type: "SWIFT_WIRE" | "US_ACH" | "US_WIRE" | "WALLET";
          url: string;
      }
      • customerName: string
      • id: string
      • OptionalmissingDetails?: string

        A sentence naming the details the recipient lacks (ACTION_REQUIRED).

      • name: string
      • paymentUrl: string
      • status: "PENDING_VERIFICATION" | "ACTION_REQUIRED" | "APPROVED" | "BLOCKED"
      • supportUrl: string
      • template: "PAYMENT_INSTRUMENT"
      • type: "SWIFT_WIRE" | "US_ACH" | "US_WIRE" | "WALLET"
      • url: string
    • {
          account: string;
          accountUrl: string;
          amount: string;
          customerName: string;
          date?: string;
          entityName: string;
          id: string;
          imad?: string;
          memo?: string;
          omad?: string;
          reference?: string;
          senderName?: string;
          status: "PENDING" | "DEPOSITED" | "CANCELLED";
          supportUrl: string;
          template: "DEPOSIT";
          type: "DIRECT" | "US_BANK_ACH" | "US_WIRE" | "SWIFT_WIRE";
          url: string;
      }
      • account: string
      • accountUrl: string
      • amount: string
      • customerName: string
      • Optionaldate?: string

        Transaction date, preformatted for display.

      • entityName: string
      • id: string
      • Optionalimad?: string
      • Optionalmemo?: string

        Description / transaction notes (FFC memo for wires).

      • Optionalomad?: string
      • Optionalreference?: string

        Reference number (IMAD for SWIFT wires).

      • OptionalsenderName?: string

        Originator / name of sender. For SWIFT deposits with no originator on the wire this is "Originator not specified" (ENG-2911).

      • status: "PENDING" | "DEPOSITED" | "CANCELLED"
      • supportUrl: string
      • template: "DEPOSIT"
      • type: "DIRECT" | "US_BANK_ACH" | "US_WIRE" | "SWIFT_WIRE"
      • url: string
    • {
          account: string;
          accountUrl: string;
          achName?: string;
          amount: string;
          customerName: string;
          entityName: string;
          id: string;
          imad?: string;
          omad?: string;
          paymentInstrumentName: string;
          status: "PENDING" | "COMPLETED" | "RETURNED";
          supportUrl: string;
          template: "WITHDRAW";
          type: "SWIFT_WIRE" | "ACH_CREDIT" | "US_WIRE" | "BLOCKCHAIN";
          url: string;
          wireName?: string;
      }
      • account: string
      • accountUrl: string
      • OptionalachName?: string

        The paying entity's own beneficiary names (docs/BENEFICIARY_NAMES.md), for copy naming how the payment appears to the payee. Never the payee's own name — that is paymentInstrumentName.

      • amount: string
      • customerName: string
      • entityName: string
      • id: string
      • Optionalimad?: string
      • Optionalomad?: string
      • paymentInstrumentName: string
      • status: "PENDING" | "COMPLETED" | "RETURNED"
      • supportUrl: string
      • template: "WITHDRAW"
      • type: "SWIFT_WIRE" | "ACH_CREDIT" | "US_WIRE" | "BLOCKCHAIN"
      • url: string
      • OptionalwireName?: string
    • {
          amount: string;
          customerName: string;
          id: string;
          senderMessage?: string;
          sourceAccount: string;
          sourceAccountUrl: string;
          sourceCustomerName?: string;
          status: "PENDING" | "CANCELLED" | "SUCCEEDED";
          supportUrl: string;
          targetAccount: string;
          targetAccountUrl: string;
          targetCustomerName?: string;
          template: "TRANSFER";
          type: "INTERNAL" | "NETWORK_SENDER" | "NETWORK_RECEIVER";
          url: string;
      }
      • amount: string
      • customerName: string
      • id: string
      • OptionalsenderMessage?: string
      • sourceAccount: string
      • sourceAccountUrl: string
      • OptionalsourceCustomerName?: string

        May be omitted: a cross-customer transfer resolves only one side, and the counterparty ledger account may have no public projection visible to this customer — the transfer path drops the field for that case rather than sending an empty string (ENG-3003), so copy has to read correctly without it.

      • status: "PENDING" | "CANCELLED" | "SUCCEEDED"
      • supportUrl: string
      • targetAccount: string
      • targetAccountUrl: string
      • OptionaltargetCustomerName?: string

        May be omitted, as sourceCustomerName.

      • template: "TRANSFER"
      • type: "INTERNAL" | "NETWORK_SENDER" | "NETWORK_RECEIVER"
      • url: string
    • {
          amount: string;
          card: string;
          id: string;
          merchantName: string;
          reason?: string;
          status: "PENDING" | "DECLINED" | "AUTHORIZED" | "COMPLETED";
          supportUrl: string;
          template: "CARD_TRANSACTION";
          type: "AUTHORIZATION" | "REVERSAL";
          url: string;
      }
    • {
          amount: string;
          currency: string;
          customerName: string;
          debitDate: string;
          id: string;
          invoiceNumber: string;
          issuedDate: string;
          periodLabel: string;
          sourceAccountName: string;
          supportUrl: string;
          template: "INVOICE";
      }
      • amount: string
      • currency: string
      • customerName: string
      • debitDate: string

        The day the email is sent, in the billing timezone: the charge follows it.

      • id: string

        The invoice's id.

      • invoiceNumber: string

        CFX-YYYYMMDD-NN.

      • issuedDate: string

        Issue date in the billing timezone, preformatted, e.g. Nov 1, 2026.

      • periodLabel: string

        The billing month, e.g. November 2026.

      • sourceAccountName: string

        The account the fee is debited from.

      • supportUrl: string
      • template: "INVOICE"

        The monthly platform fee's invoice, mailed before the fee is taken.

    • {
          amount: string;
          currency: string;
          customerName: string;
          feeTransferId: string;
          id: string;
          invoiceNumber: string;
          paidAt: string;
          periodLabel: string;
          sourceAccountName: string;
          supportUrl: string;
          template: "RECEIPT";
          transactionSignature: string;
      }
      • amount: string
      • currency: string
      • customerName: string
      • feeTransferId: string
      • id: string

        The invoice's id.

      • invoiceNumber: string
      • paidAt: string

        When the transfer settled, in the billing timezone, preformatted.

      • periodLabel: string
      • sourceAccountName: string
      • supportUrl: string
      • template: "RECEIPT"

        The receipt for a settled platform fee, naming the invoice it pays.

      • transactionSignature: string

        On-chain signature of the fee transfer.

    • {
          code: string;
          email: string;
          status:
              | "SIGN_UP"
              | "RESEND_CODE"
              | "FORGOT_PASSWORD"
              | "UPDATE_USER_ATTRIBUTE"
              | "VERIFY_USER_ATTRIBUTE"
              | "ADMIN_CREATE_USER"
              | "AUTHENTICATION";
          supportUrl: string;
          template: "AUTH";
      }

      Cognito's own mail, sent by email-notification-handler as the platform and bank pools' Custom Email Sender. status is the trigger source.

      • code: string

        The code, or ADMIN_CREATE_USER's temporary password.

      • email: string

        The recipient, which is also the username a temporary password signs in with.

      • status:
            | "SIGN_UP"
            | "RESEND_CODE"
            | "FORGOT_PASSWORD"
            | "UPDATE_USER_ATTRIBUTE"
            | "VERIFY_USER_ATTRIBUTE"
            | "ADMIN_CREATE_USER"
            | "AUTHENTICATION"
      • supportUrl: string
      • template: "AUTH"
    • {
          email: string;
          status: "ACCOUNT_TAKE_OVER_NOTIFICATION";
          supportUrl: string;
          template: "AUTH";
      }
      • email: string
      • status: "ACCOUNT_TAKE_OVER_NOTIFICATION"

        No code: Cognito's event carries none, so copy must not use one.

      • supportUrl: string
      • template: "AUTH"
    • {
          id: string;
          name: string;
          status: "SUBMITTED" | "INFO_REQUESTED" | "DECLINED" | "APPROVED";
          supportUrl: string;
          template: "APPLICATION";
          url: string;
      }

      A self-serve application's progress, sent to its workspace's members by email-notification-handler from customer.application.statusUpdated.

      • id: string
      • name: string

        The business name the applicant gave.

      • status: "SUBMITTED" | "INFO_REQUESTED" | "DECLINED" | "APPROVED"
      • supportUrl: string
      • template: "APPLICATION"
      • url: string

        The application's status page; the dashboard's sign-in once APPROVED.