Archive
Source:
src/AWS/MailManager/Archive.ts
An SES Mail Manager email archive — durable storage for emails captured
by an Archive rule action, searchable and exportable for compliance.
Deleting an archive puts it into PENDING_DELETION for 30 days before
its contents are permanently removed; the archive cannot be revived, so
the provider treats a pending-deletion archive as gone.
Creating Archives
Section titled “Creating Archives”import * as MailManager from "alchemy/AWS/MailManager";
const archive = yield* MailManager.Archive("Compliance", { retentionPeriod: "ONE_YEAR",});
const ruleSet = yield* MailManager.RuleSet("Inbound", { rules: [ { Name: "ArchiveAll", Actions: [{ Archive: { TargetArchive: archive.archiveId } }], }, ],});Searching the Archive at Runtime
Section titled “Searching the Archive at Runtime”// init — bind the search capabilities to the archiveconst startSearch = yield* MailManager.StartArchiveSearch(archive);const getSearchResults = yield* MailManager.GetArchiveSearchResults(archive);
// runtimeconst { SearchId } = yield* startSearch({ FromTimestamp: new Date(Date.now() - 86_400_000), ToTimestamp: new Date(), MaxResults: 100,});