-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Sendgrid with Resend email service (#298)
* replace sendgrid with resend * correct comments * refactor: move resend client to EmailService class * feat: add debug logs when api key was not provided * fix: fix email types according to resend lib * feat: change email from value in email service --------- Co-authored-by: Egor Skoropanov <[email protected]> Co-authored-by: fruneen <[email protected]>
- Loading branch information
1 parent
ce0f878
commit d6f45e3
Showing
6 changed files
with
47 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
import { Template, TemplateProps } from 'mailer'; | ||
|
||
export type From = { email: string; name: string }; | ||
export type From = { | ||
email: string; | ||
name: string; | ||
}; | ||
|
||
export interface EmailServiceConstructorProps { | ||
apiKey: string | undefined; | ||
from: From; | ||
} | ||
|
||
interface Attachment { | ||
content: string; | ||
filename: string; | ||
type?: string; | ||
/** Content of an attached file. */ | ||
content?: string | Buffer; | ||
/** Name of attached file. */ | ||
filename?: string | false | undefined; | ||
/** Path where the attachment file is hosted */ | ||
path?: string; | ||
} | ||
|
||
export interface SendTemplateParams<T extends Template> { | ||
to: string; | ||
to: string | string[]; | ||
subject: string; | ||
template: T; | ||
params: TemplateProps[T]; | ||
attachments?: Attachment[]; | ||
} | ||
|
||
export interface SendSendgridTemplateParams { | ||
to: string; | ||
subject: string; | ||
templateId: string; | ||
dynamicTemplateData: { [key: string]: unknown }; | ||
attachments?: Attachment[]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.