Invite prefill email (#43)
* Add prepopulation of email field in sign-up form * Updated packages
This commit is contained in:
committed by
GitHub
parent
4f0e6b9bbb
commit
21f42f14ce
@@ -5,4 +5,4 @@ export * from './invitations/account-invitations-table';
|
||||
export * from './settings/team-account-settings-container';
|
||||
export * from './invitations/accept-invitation-container';
|
||||
export * from './create-team-account-dialog';
|
||||
export * from './team-account-workspace-context';
|
||||
export * from './team-account-workspace-context';
|
||||
|
||||
@@ -102,9 +102,10 @@ class AccountInvitationsWebhookService {
|
||||
const { getMailer } = await import('@kit/mailers');
|
||||
|
||||
const mailer = await getMailer();
|
||||
const link = this.getInvitationLink(invitation.invite_token, invitation.email);
|
||||
|
||||
const { html, subject } = await renderInviteEmail({
|
||||
link: this.getInvitationLink(invitation.invite_token),
|
||||
link,
|
||||
invitedUserEmail: invitation.email,
|
||||
inviter: inviter.data.name ?? inviter.data.email ?? '',
|
||||
productName: env.productName,
|
||||
@@ -141,7 +142,14 @@ class AccountInvitationsWebhookService {
|
||||
}
|
||||
}
|
||||
|
||||
private getInvitationLink(token: string) {
|
||||
return new URL(env.invitePath, env.siteURL).href + `?invite_token=${token}`;
|
||||
private getInvitationLink(token: string, email: string) {
|
||||
const searchParams = new URLSearchParams({
|
||||
invite_token: token,
|
||||
email,
|
||||
}).toString();
|
||||
|
||||
const href = new URL(env.invitePath, env.siteURL).href;
|
||||
|
||||
return `${href}?${searchParams}`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user