Files
outline/server/queues/tasks/EmailTask.ts
T
Tom Moor fca10221b9 chore: promote no-explicit-any from warn to error (#12244)
* chore: promote no-explicit-any from warn to error and resolve violations

Upgrades the oxlint rule severity and removes all 40 existing
`no-explicit-any` warnings across the codebase. Most call sites gained
proper types (SharedEditor refs, JSONNode/JSONMark for ProseMirror JSON
walking, DocumentsStore, dd-trace `Span` parameter inference, prosemirror
Fragment public API in place of internal `(fragment as any).content`).
A few load-bearing `any` uses were preserved with scoped disable
comments where changing the type would cascade widely (Sequelize JSONB
columns on `Event`, the `withTracing` higher-order function generic,
`Extension.options` consumed by many subclasses, dd-trace's `req`
patching).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 12:14:23 -04:00

23 lines
656 B
TypeScript

import emails from "@server/emails/templates";
import { BaseTask } from "./base/BaseTask";
type Props = {
templateName: string;
props: Record<string, unknown>;
};
export default class EmailTask extends BaseTask<Props> {
public async perform({ templateName, props, ...metadata }: Props) {
const EmailClass = emails[templateName];
if (!EmailClass) {
throw new Error(
`Email task "${templateName}" template does not exist. Check the file name matches the class name.`
);
}
// @ts-expect-error We won't instantiate an abstract class
const email = new EmailClass(props, metadata);
return email.send();
}
}