Comlink
Beskar Labs internal mailing system.
Installation
yarn add @beskar-labs/comlink
Usage
import { comlink } from '@beskar-labs/comlink';
import type { ComlinkMetadataProps, ComlinkTemplateProps, ComlinkHeaderProps } from '@beskar-labs/comlink';
const metadata: ComlinkMetadataProps = {
to: 'janesmith@acme.com',
from: 'noreply@beskar.co',
replyTo: 'noreply@beskar.co',
subject: 'Sign in to Refraction',
};
const template: ComlinkTemplateProps = {
title: 'Sign in to Refraction',
body: 'You are receiving this email because you (or someone else) have requested the link to sign in to your account. Click the button below to sign in.',
cta: {
text: 'Sign in',
href: url,
},
outro: 'If you did not request this, please ignore this email.',
footer:
'This email was sent to you because you have an account with Refraction, or you are creating one. If you did not request this, please ignore this email.',
logo: 'data:image/png;base64,...',
};
const headers: ComlinkHeaderProps = {
passphrase: process.env.COMLINK_PASSPHRASE,
resendToken: process.env.RESEND_TOKEN,
};
comlink(metadata, template, headers);