This commit refactors how SMTP configuration for mailers is set up and introduces schema validation for incoming configurations. The mailer modules have been restructured, with schema definition files added, and redundant codes removed. Moreover, web application configuration now has minimum validation on name and title, and URL validation has been added.
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
Send an email
import { Mailer } from '@kit/mailers';
const mailer = new Mailer();
mailer.send({
to: '',
from: '',
subject: 'Hello',
text: 'Hello, World!'
});