feat(template): allow to customize endpoint for Welcome template

This commit is contained in:
Julien Oculi 2024-06-15 17:23:58 +02:00
parent 5476c9d6a6
commit 2a372f5320

View file

@ -16,10 +16,11 @@ import { bodyCss, messageCss, rootCss, textCss } from './styles/base.tsx'
import { BaseStyle } from './styles/base.tsx'
function Welcome(
{ firstname, lastname, login }: {
{ firstname, lastname, login, endpoint }: {
firstname: string
lastname: string
login: string
endpoint?: string
},
) {
return (
@ -88,7 +89,12 @@ function Welcome(
<Container
style={{ width: '100%', textAlign: 'center', padding: '1rem' }}
>
<Button href='https://cohabit.fr/profil' style={buttonCss}>
<Button
href={(endpoint && endpoint.length > 1)
? endpoint
: 'https://cohabit.fr/profil'}
style={buttonCss}
>
Accéder à mon compte
</Button>
</Container>
@ -153,6 +159,13 @@ const template: Template<typeof Welcome, Parameters<typeof Welcome>[0]> = {
multiline: false,
tag: 'login',
},
{
name: 'Endpoint',
description: 'Endpoint du lien "Accéder à mon compte"',
required: false,
multiline: false,
tag: 'endpoint',
},
],
name: 'welcome',
description: 'Coh@bit welcome mail for new users.',