import { Reception } from './classes.reception.js'; import { RegistrationSession } from './classes.registrationsession.js'; import { User } from './classes.user.js'; import * as plugins from '../plugins.js'; export class ReceptionMailer { public receptionRef: Reception; constructor(receptionRefArg: Reception) { this.receptionRef = receptionRefArg; } private createBodyString = (textArg) => `
${textArg}
`; public sendRegistrationEmail(signupSessionArg: RegistrationSession, validationTokenArg: string) { this.receptionRef.szPlatformClient.emailConnector.sendEmail({ from: 'workspace.global ', title: 'Verify your Email Address!', to: signupSessionArg.emailAddress, body: this.createBodyString(`

Email Verification for
${signupSessionArg.emailAddress}

It looks like you requested to register an account with us. We just want to make sure it really was you.

In case it was you, please continue with the registration process by clicking the button below. Otherwise, please ignore this email.

continue with registration

What do I need a workspace.global Account for?
The workspace.global Account is needed to log into e.g. social.io

`), }); } public sendAlreadyRegisteredEmail(userArg: User) { this.receptionRef.szPlatformClient.emailConnector.sendEmail({ from: 'workspace.global ', title: 'Login Instead?!', to: userArg.data.email, body: this.createBodyString(`

Email is already registered:
${userArg.data.email}

Someone retried to reregister with the email ${userArg.data.email}

In case it was you, please simply log in with your existing account. Otherwise, please ignore this email.

Simply login :)

Forgot your password?
Just click the password reset link when logging in.

`), }); } public sendWelcomeEMail(userArg: User) { this.receptionRef.szPlatformClient.emailConnector.sendEmail({ from: 'workspace.global ', title: 'Welcome and Thank You!', to: userArg.data.email, body: this.createBodyString(`

Welcome And Thank You, ${userArg.data.name}

You now have a fully registered workspace.global Account

What can I use it for?
The workspace.global Account can be used to log into all our apps.
Some of them are
${(() => { const products = ['social.io', 'layer.io']; return products.map((productArg) => `${productArg}`).join(' '); })()}

Go to my account
`), }); } public sendLoginWithEMailMail(userArg: User, validationTokenArg: string) { this.receptionRef.szPlatformClient.emailConnector.sendEmail({ from: 'workspace.global ', title: 'Click to login!', to: userArg.data.email, body: this.createBodyString(`

EMail Login Link for
${userArg.data.email}

It looks like you requested to login passwordless via this email.

In case it was you, please continue by clicking the button below. Otherwise, please ignore this email.

Login!
`), }); } public sendPasswordResetMail(userArg: User, validationTokenArg: string) { this.receptionRef.szPlatformClient.emailConnector.sendEmail({ from: 'workspace.global ', title: 'Password reset?', to: userArg.data.email, body: this.createBodyString(`

Password Reset for
${ userArg.data.email }

It looks like you requested to reset your password with us.

In case it was you, please continue by clicking the button below. Otherwise, please ignore this email.

Reset Password
`), }); } }