Files
classroomio/src/lib/utils/services/sendgrid.ts
T
Rotimi BestandRotimi Best 7a5d341865 CLASSROOMIO-T-133: Send welcome email after onboarding
Co-authored-by: Rotimi Best <rotimiibitoyeemma@gmail.com>


Merge-request: CLASSROOMIO-MR-55
Merged-by: Best Admin <best@digdippa.com>
2023-08-26 11:58:57 +00:00

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 <best@classroomio.com>';
export let sendgrid: MailService;
export const getSendgrid = (): MailService => {
if (sendgrid) return sendgrid;
SendGridService.setApiKey(SENDGRID_API_KEY);
sendgrid = SendGridService;
return sendgrid;
};