Refactor mailer setup and validate web configuration in app
This commit refactors how SMTP configuration for mailers is set up and introduces schema validation for incoming configurations. The mailer modules have been restructured, with schema definition files added, and redundant codes removed. Moreover, web application configuration now has minimum validation on name and title, and URL validation has been added.
This commit is contained in:
17
packages/mailers/src/impl/cloudflare/index.ts
Normal file
17
packages/mailers/src/impl/cloudflare/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'server-only';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { Mailer } from '../../mailer';
|
||||
import { MailerSchema } from '../../schema/mailer.schema';
|
||||
|
||||
type Config = z.infer<typeof MailerSchema>;
|
||||
|
||||
/**
|
||||
* A class representing a mailer using Cloudflare's Workers.
|
||||
* @implements {Mailer}
|
||||
*/
|
||||
export class CloudflareMailer implements Mailer {
|
||||
async sendEmail(config: Config) {
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user