feat: middlename
This commit is contained in:
parent
0f4c8b2051
commit
6eff243803
@ -131,7 +131,7 @@ export class RunnerSelfServiceController {
|
||||
const token = JwtCreator.createSelfService(runner);
|
||||
|
||||
try {
|
||||
await Mailer.sendSelfserviceForgottenMail(runner.email, runner.id, runner.firstname, runner.lastname, token, locale)
|
||||
await Mailer.sendSelfserviceForgottenMail(runner.email, runner.id, runner.firstname, runner.middlename, runner.lastname, token, locale)
|
||||
} catch (error) {
|
||||
throw new MailSendingError();
|
||||
}
|
||||
@ -157,7 +157,7 @@ export class RunnerSelfServiceController {
|
||||
response.token = JwtCreator.createSelfService(runner);
|
||||
|
||||
try {
|
||||
await Mailer.sendSelfserviceWelcomeMail(runner.email, runner.id, runner.firstname, runner.lastname, response.token, locale)
|
||||
await Mailer.sendSelfserviceWelcomeMail(runner.email, runner.id, runner.firstname, runner.middlename, runner.lastname, response.token, locale)
|
||||
} catch (error) {
|
||||
throw new MailSendingError();
|
||||
}
|
||||
@ -182,7 +182,7 @@ export class RunnerSelfServiceController {
|
||||
response.token = JwtCreator.createSelfService(runner);
|
||||
|
||||
try {
|
||||
await Mailer.sendSelfserviceWelcomeMail(runner.email, runner.id, runner.firstname, runner.lastname, response.token, locale)
|
||||
await Mailer.sendSelfserviceWelcomeMail(runner.email, runner.id, runner.firstname, runner.middlename, runner.lastname, response.token, locale)
|
||||
} catch (error) {
|
||||
throw new MailSendingError();
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ export class Mailer {
|
||||
* @param to_address The address the mail will be sent to. Should always get pulled from a runner object.
|
||||
* @param token The requested selfservice token - will be combined with the app_url to generate a selfservice profile link.
|
||||
*/
|
||||
public static async sendSelfserviceWelcomeMail(to_address: string, runner_id: number, firstname: string, lastname: string, token: string, locale: string = "en") {
|
||||
public static async sendSelfserviceWelcomeMail(to_address: string, runner_id: number, firstname: string, middlename: string, lastname: string, token: string, locale: string = "en") {
|
||||
try {
|
||||
await axios.request({
|
||||
method: 'POST',
|
||||
@ -57,7 +57,7 @@ export class Mailer {
|
||||
templateName: 'welcome',
|
||||
language: locale,
|
||||
data: {
|
||||
name: `${firstname} ${lastname}`,
|
||||
name: `${firstname} ${middlename} ${lastname}`,
|
||||
barcode_content: `${runner_id}`,
|
||||
link: 'https://portal.lauf-fuer-kaya.de/profile/' + token
|
||||
}
|
||||
@ -74,7 +74,7 @@ export class Mailer {
|
||||
* @param to_address The address the mail will be sent to. Should always get pulled from a runner object.
|
||||
* @param token The requested selfservice token - will be combined with the app_url to generate a selfservice profile link.
|
||||
*/
|
||||
public static async sendSelfserviceForgottenMail(to_address: string, runner_id: number, firstname: string, lastname: string, token: string, locale: string = "en") {
|
||||
public static async sendSelfserviceForgottenMail(to_address: string, runner_id: number, firstname: string, middlename: string, lastname: string, token: string, locale: string = "en") {
|
||||
try {
|
||||
await axios.request({
|
||||
method: 'POST',
|
||||
@ -88,7 +88,7 @@ export class Mailer {
|
||||
templateName: 'welcome',
|
||||
language: locale,
|
||||
data: {
|
||||
name: `${firstname} ${lastname}`,
|
||||
name: `${firstname} ${middlename} ${lastname}`,
|
||||
barcode_content: `${runner_id}`,
|
||||
link: 'https://portal.lauf-fuer-kaya.de/profile/' + token
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user