-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(te): Refactor TEs to use authority and lots of cleanup (#1056)
* Update with tempExt and appks * Addd 1915b appks * Update * Update * Update * Fix TEs - tighten up types and 'namespaces' * nothing waisted, nothing unknown
- Loading branch information
1 parent
52d31b6
commit 44b3931
Showing
8 changed files
with
103 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,48 @@ | ||
import { EmailAddresses, Events } from "shared-types"; | ||
import { Authority, EmailAddresses, Events } from "shared-types"; | ||
import { CommonEmailVariables } from "shared-types"; | ||
import { UserTypeOnlyTemplate } from "../.."; | ||
import { AuthoritiesWithUserTypesTemplate } from "../.."; | ||
import { render } from "@react-email/render"; | ||
import { TempExtCMSEmail, TempExtStateEmail } from "./emailTemplates"; | ||
|
||
export const tempExtention: UserTypeOnlyTemplate = { | ||
cms: async ( | ||
variables: Events["TemporaryExtension"] & CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: variables.emails.osgEmail, | ||
subject: `${variables.authority} Waiver Extension ${variables.id} Submitted`, | ||
body: await render(<TempExtCMSEmail variables={variables} />), | ||
}; | ||
export const tempExtension: AuthoritiesWithUserTypesTemplate = { | ||
[Authority["1915b"]]: { | ||
cms: async ( | ||
variables: Events["TemporaryExtension"] & CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: variables.emails.osgEmail, | ||
subject: `${variables.authority} Waiver Extension ${variables.id} Submitted`, | ||
body: await render(<TempExtCMSEmail variables={variables} />), | ||
}; | ||
}, | ||
state: async ( | ||
variables: Events["TemporaryExtension"] & CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: [`${variables.submitterName} <${variables.submitterEmail}>`], | ||
subject: `Your Request for the ${variables.authority} Waiver Extension ${variables.id} has been submitted to CMS`, | ||
body: await render(<TempExtStateEmail variables={variables} />), | ||
}; | ||
}, | ||
}, | ||
state: async ( | ||
variables: Events["TemporaryExtension"] & CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: [`${variables.submitterName} <${variables.submitterEmail}>`], | ||
subject: `Your Request for the ${variables.authority} Waiver Extension ${variables.id} has been submitted to CMS`, | ||
body: await render(<TempExtStateEmail variables={variables} />), | ||
}; | ||
[Authority["1915c"]]: { | ||
cms: async ( | ||
variables: Events["TemporaryExtension"] & CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: variables.emails.osgEmail, | ||
subject: `${variables.authority} Waiver Extension ${variables.id} Submitted`, | ||
body: await render(<TempExtCMSEmail variables={variables} />), | ||
}; | ||
}, | ||
state: async ( | ||
variables: Events["TemporaryExtension"] & CommonEmailVariables & { emails: EmailAddresses }, | ||
) => { | ||
return { | ||
to: [`${variables.submitterName} <${variables.submitterEmail}>`], | ||
subject: `Your Request for the ${variables.authority} Waiver Extension ${variables.id} has been submitted to CMS`, | ||
body: await render(<TempExtStateEmail variables={variables} />), | ||
}; | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters