yarn add @big-whale-labs/seal-cred-email
Add .env
into project root if you need one:
Name | Description |
---|---|
SEALCRED_ADDRESS |
Address, where the assets (images) will be loaded from |
import { createTransport } from 'nodemailer'
import { token } from '@big-whale-labs/seal-cred-email'
import env from '@/helpers/env'
const user = env.SMTP_USER
const pass = env.SMTP_PASS
const emailer = createTransport({
host: 'box.mail.sealcred.xyz',
port: 465,
secure: true,
auth: {
user,
pass,
},
})
export default function (to: string, subject: string, text: string) {
return emailer.sendMail({
from: `"SealCred" <${user}>`,
to,
subject,
html: token.replace('{{token}}', text),
})
}
- Install dependencies with
yarn
- Run the server with
yarn start
- Run
yarn link
in the root folder, more about yarn link - Run develop mode with
yarn start
- In another project. Run
yarn link @big-whale-labs/seal-cred-email
- Nice! Your project will now use the local version of
@big-whale-labs/seal-cred-email
yarn start
— runs email templates in the development modeyarn build
— builds email templates for production to thedist
folderyarn release
— create a release and publish the package usingci