Enterprise-CMCS/macpro-mako

View on GitHub
lib/libs/email/content/withdrawConfirmation/index.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { Authority, CommonEmailVariables, EmailAddresses, Events } from "shared-types";
import { AuthoritiesWithUserTypesTemplate } from "../..";
import { WaiverStateEmail } from "./emailTemplates";
import { render } from "@react-email/render";

export const withdrawConfirmation: AuthoritiesWithUserTypesTemplate = {
  [Authority["1915b"]]: {
    state: async (
      variables: Events["WithdrawPackage"] & CommonEmailVariables & { emails: EmailAddresses },
    ) => {
      return {
        to: [`${variables.submitterName} <${variables.submitterEmail}>`], // TODO: change to all state users
        subject: `1915(b) ${variables.id} Withdrawal Confirmation`,
        body: await render(<WaiverStateEmail variables={variables} />),
      };
    },
  },
  [Authority["1915c"]]: {
    state: async (
      variables: Events["WithdrawPackage"] & CommonEmailVariables & { emails: EmailAddresses },
    ) => {
      return {
        to: [`${variables.submitterName} <${variables.submitterEmail}>`], // TODO: change to all state users
        subject: `1915(c) ${variables.id} Withdrawal Confirmation`,
        body: await render(<WaiverStateEmail variables={variables} />),
      };
    },
  },
  //   TODO: add CHIP & SPA Withdraw Confirmation Here
};