Initial import

This commit is contained in:
sirily
2026-03-10 14:03:52 +03:00
commit 6c0ca4e28b
102 changed files with 6598 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
export interface SendEmailInput {
to: string;
subject: string;
text: string;
}
export interface EmailTransport {
send(input: SendEmailInput): Promise<void>;
}
export function createEmailTransport(config: {
provider: string;
from: string;
apiKey: string;
}): EmailTransport {
if (config.provider === "example") {
return {
async send(input) {
console.log(
JSON.stringify({
service: "email",
provider: config.provider,
from: config.from,
to: input.to,
subject: input.subject,
text: input.text,
}),
);
},
};
}
return {
async send(input) {
console.log(
JSON.stringify({
service: "email",
provider: config.provider,
mode: "noop_fallback",
from: config.from,
to: input.to,
subject: input.subject,
text: input.text,
}),
);
},
};
}