Files
myeasycms-v2/packages/mailers/README.md
giancarlo 9fca45c2de Replace Logger with getLogger and update next version
This commit replaces the use of Logger with getLogger in various parts of the code to handle logging. The Logger has been replaced with getLogger, which assists in getting logs in an asynchronous manner. In addition to this, it updates the next version in pnpm-lock.yaml from next@14.2.0-canary.61 to next@14.2.0-canary.62 and various other dependencies. Also made minor annotations and comments to the function 'isBrowser' and 'formatCurrency' in the 'utils.ts' file.
2024-04-08 12:23:15 +08:00

842 B

Mailers - @kit/mailers

This package is responsible for sending emails using a unified interface across the app.

The default mailer uses the nodemailer package to send emails. You can create custom mailers by extending the Mailer class.

Make sure the app installs the @kit/mailers package before using it.

{
    "name": "my-app",
    "dependencies": {
        "@kit/mailers": "*"
    }
}

Usage

By default, the package uses nodemailer.

To use Cloudflare, please set the environment variable MAILER_PROVIDER to cloudflare.

MAILER_PROVIDER=cloudflare

Send an email

import { getMailer } from '@kit/mailers';

async function sendEmail() {
  const mailer = await getMailer();

  return mailer.sendEmail({
    to: '',
    from: '',
    subject: 'Hello',
    text: 'Hello, World!'
  });
}