ตรวจสอบแก้ไชสร้างเอกสาร

This commit is contained in:
phaichayon
2026-06-30 17:35:03 +07:00
parent a4fd166c51
commit e5766ea311
40 changed files with 8288 additions and 106 deletions

View File

@@ -0,0 +1,21 @@
import 'server-only';
import { EmailNotificationProvider } from './email-provider';
import type { NotificationChannel, NotificationProvider } from '../types';
export function getNotificationProvider(
channel: NotificationChannel,
providerKey?: string,
): NotificationProvider {
if (channel === 'email') {
const provider = new EmailNotificationProvider();
if (providerKey && provider.key !== providerKey) {
throw new Error(`Unsupported email provider: ${providerKey}`);
}
return provider;
}
throw new Error(`Notification provider for channel ${channel} is not implemented yet.`);
}