diff --git a/src/index.ts b/src/index.ts index 29e65e58006..87bb3f22be1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ export * from './lib/notifire'; export * from './lib/notifire.interface'; export * from './lib/template/template.interface'; -export * from './providers/sendgrid.provider'; +export * from './lib/provider/provider.interface'; diff --git a/src/providers/sendgrid.provider.ts b/src/providers/sendgrid.provider.ts deleted file mode 100644 index a517d0722b0..00000000000 --- a/src/providers/sendgrid.provider.ts +++ /dev/null @@ -1,35 +0,0 @@ -import sendgridMail from '@sendgrid/mail'; - -import { IEmailProvider } from '../lib/provider/provider.interface'; -import { - ChannelTypeEnum, - ITriggerPayload, -} from '../lib/template/template.interface'; - -export class SendgridProvider implements IEmailProvider { - id = 'sendgrid'; - channelType = ChannelTypeEnum.EMAIL as ChannelTypeEnum.EMAIL; - - constructor( - private config: { - apiKey: string; - } - ) { - sendgridMail.setApiKey(this.config.apiKey); - } - - async sendMessage( - to: string, - subject: string, - html: string, - attributes: ITriggerPayload - ): Promise { - return await sendgridMail.send({ - from: 'dima@notifire.co', - to: to, - html: html, - subject: subject, - substitutions: attributes as { [key: string]: string }, - }); - } -}