feat: invite new user with email

This commit is contained in:
Elias Schneider
2023-02-21 08:51:04 +01:00
parent 759c55f625
commit f9840505b8
10 changed files with 111 additions and 29 deletions

View File

@@ -73,6 +73,20 @@ export class EmailService {
});
}
async sendInviteEmail(recipientEmail: string, password: string) {
const loginUrl = `${this.config.get("APP_URL")}/auth/signIn`;
await this.getTransporter().sendMail({
from: `"Pingvin Share" <${this.config.get("SMTP_EMAIL")}>`,
to: recipientEmail,
subject: this.config.get("INVITE_EMAIL_SUBJECT"),
text: this.config
.get("INVITE_EMAIL_MESSAGE")
.replaceAll("{url}", loginUrl)
.replaceAll("{password}", password),
});
}
async sendTestMail(recipientEmail: string) {
try {
await this.getTransporter().sendMail({