Co-authored-by: Rotimi Best <[email protected]> Merge-request: CLASSROOMIO-MR-55 Merged-by: Best Admin <[email protected]>
18 lines
445 B
TypeScript
18 lines
445 B
TypeScript
import * as SendGridService from '@sendgrid/mail';
|
|
import type { MailService } from '@sendgrid/mail';
|
|
import { SENDGRID_API_KEY } from '$env/static/private';
|
|
|
|
export const SENDGRID_FROM = 'Rotimi Best <[email protected]>';
|
|
|
|
export let sendgrid: MailService;
|
|
|
|
export const getSendgrid = (): MailService => {
|
|
if (sendgrid) return sendgrid;
|
|
|
|
SendGridService.setApiKey(SENDGRID_API_KEY);
|
|
|
|
sendgrid = SendGridService;
|
|
|
|
return sendgrid;
|
|
};
|