Genezio Email Service
Send emails from your application with genezio email service.
Install
Add the library to your project with the following command:
npm install @genezio/email-service
Import the library in your project the following way:
import { MailService } from "@genezio/email-service";
Basic usage
import { GenezioDeploy } from "@genezio/types";
import { MailService } from "@genezio/email-service";
@GenezioDeploy()
export class EmailService {
async sendEmail(email: string, subject: string, message: string) {
const response = await MailService.sendMail({
emailServiceToken: "<token>",
from: email,
to: email,
subject: subject,
text: message
});
if (!response.success) {
return response.errorMessage;
}
return "success";
}
}
More informations about how to create a new enail service can be found here.
Learn more
For more details on how to use genezio, check the resources below:
Troubleshooting
If you are having issues with this library, feel free to contact us on Discord.