mirror of
https://github.com/documenso/documenso.git
synced 2025-11-26 06:32:08 +10:00
fix: update email wording
This commit is contained in:
@ -39,13 +39,16 @@ export const DocumentInviteEmailTemplate = ({
|
|||||||
selfSigner = false,
|
selfSigner = false,
|
||||||
isTeamInvite = false,
|
isTeamInvite = false,
|
||||||
teamName,
|
teamName,
|
||||||
|
teamEmail,
|
||||||
}: DocumentInviteEmailTemplateProps) => {
|
}: DocumentInviteEmailTemplateProps) => {
|
||||||
const action = RECIPIENT_ROLES_DESCRIPTION[role].actionVerb.toLowerCase();
|
const action = RECIPIENT_ROLES_DESCRIPTION[role].actionVerb.toLowerCase();
|
||||||
|
|
||||||
const previewText = selfSigner
|
const previewText = selfSigner
|
||||||
? `Please ${action} your document ${documentName}`
|
? `Please ${action} your document ${documentName}`
|
||||||
: isTeamInvite
|
: isTeamInvite
|
||||||
? `${inviterName} on behalf of ${teamName} has invited you to ${action} ${documentName}`
|
? `${inviterName} on behalf of ${teamName}${
|
||||||
|
teamEmail ? ` (${teamEmail})` : ''
|
||||||
|
} has invited you to ${action} ${documentName}`
|
||||||
: `${inviterName} has invited you to ${action} ${documentName}`;
|
: `${inviterName} has invited you to ${action} ${documentName}`;
|
||||||
|
|
||||||
const getAssetUrl = (path: string) => {
|
const getAssetUrl = (path: string) => {
|
||||||
@ -92,9 +95,14 @@ export const DocumentInviteEmailTemplate = ({
|
|||||||
<Container className="mx-auto mt-12 max-w-xl">
|
<Container className="mx-auto mt-12 max-w-xl">
|
||||||
<Section>
|
<Section>
|
||||||
<Text className="my-4 text-base font-semibold">
|
<Text className="my-4 text-base font-semibold">
|
||||||
{inviterName}{' '}
|
{isTeamInvite && teamName
|
||||||
<Link className="font-normal text-slate-400" href="mailto:{inviterEmail}">
|
? `${inviterName} on behalf of ${teamName}`
|
||||||
({inviterEmail})
|
: inviterName}{' '}
|
||||||
|
<Link
|
||||||
|
className="font-normal text-slate-400"
|
||||||
|
href={`mailto:${teamEmail || inviterEmail}`}
|
||||||
|
>
|
||||||
|
({teamEmail || inviterEmail})
|
||||||
</Link>
|
</Link>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
@ -102,7 +110,9 @@ export const DocumentInviteEmailTemplate = ({
|
|||||||
{customBody ? (
|
{customBody ? (
|
||||||
<pre className="font-sans text-base text-slate-400">{customBody}</pre>
|
<pre className="font-sans text-base text-slate-400">{customBody}</pre>
|
||||||
) : (
|
) : (
|
||||||
`${inviterName} has invited you to ${action} the document "${documentName}".`
|
`${inviterName} ${
|
||||||
|
isTeamInvite ? `on behalf of ${teamName}` : ''
|
||||||
|
} has invited you to ${action} the document "${documentName}".`
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</Section>
|
</Section>
|
||||||
|
|||||||
@ -120,7 +120,7 @@ export const SEND_SIGNING_EMAIL_JOB_DEFINITION = {
|
|||||||
const template = createElement(DocumentInviteEmailTemplate, {
|
const template = createElement(DocumentInviteEmailTemplate, {
|
||||||
documentName: document.title,
|
documentName: document.title,
|
||||||
inviterName: user.name || undefined,
|
inviterName: user.name || undefined,
|
||||||
inviterEmail: isTeamDocument ? team?.teamEmail?.email || user.email : user.email,
|
inviterEmail: user.email,
|
||||||
assetBaseUrl,
|
assetBaseUrl,
|
||||||
signDocumentLink,
|
signDocumentLink,
|
||||||
customBody: renderCustomEmailTemplate(emailMessage, customEmailTemplate),
|
customBody: renderCustomEmailTemplate(emailMessage, customEmailTemplate),
|
||||||
|
|||||||
@ -125,7 +125,7 @@ export const resendDocument = async ({
|
|||||||
const template = createElement(DocumentInviteEmailTemplate, {
|
const template = createElement(DocumentInviteEmailTemplate, {
|
||||||
documentName: document.title,
|
documentName: document.title,
|
||||||
inviterName: user.name || undefined,
|
inviterName: user.name || undefined,
|
||||||
inviterEmail: isTeamDocument ? document.team?.teamEmail?.email || user.email : user.email,
|
inviterEmail: user.email,
|
||||||
assetBaseUrl,
|
assetBaseUrl,
|
||||||
signDocumentLink,
|
signDocumentLink,
|
||||||
customBody: renderCustomEmailTemplate(emailMessage, customEmailTemplate),
|
customBody: renderCustomEmailTemplate(emailMessage, customEmailTemplate),
|
||||||
@ -133,6 +133,7 @@ export const resendDocument = async ({
|
|||||||
selfSigner,
|
selfSigner,
|
||||||
isTeamInvite: isTeamDocument,
|
isTeamInvite: isTeamDocument,
|
||||||
teamName: document.team?.name,
|
teamName: document.team?.name,
|
||||||
|
teamEmail: document.team?.teamEmail?.email,
|
||||||
});
|
});
|
||||||
|
|
||||||
await prisma.$transaction(
|
await prisma.$transaction(
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import path from 'node:path';
|
|||||||
import { hashSync } from '@documenso/lib/server-only/auth/hash';
|
import { hashSync } from '@documenso/lib/server-only/auth/hash';
|
||||||
|
|
||||||
import { prisma } from '..';
|
import { prisma } from '..';
|
||||||
import { DocumentDataType, DocumentSource, Role, TeamMemberRole } from '../client';
|
import { DocumentDataType, DocumentSource, Role } from '../client';
|
||||||
|
|
||||||
export const seedDatabase = async () => {
|
export const seedDatabase = async () => {
|
||||||
const examplePdf = fs
|
const examplePdf = fs
|
||||||
@ -67,64 +67,4 @@ export const seedDatabase = async () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const testUsers = [
|
|
||||||
'test@documenso.com',
|
|
||||||
'test2@documenso.com',
|
|
||||||
'test3@documenso.com',
|
|
||||||
'test4@documenso.com',
|
|
||||||
];
|
|
||||||
|
|
||||||
const createdUsers = [];
|
|
||||||
|
|
||||||
for (const email of testUsers) {
|
|
||||||
const testUser = await prisma.user.upsert({
|
|
||||||
where: {
|
|
||||||
email: email,
|
|
||||||
},
|
|
||||||
create: {
|
|
||||||
name: 'Test User',
|
|
||||||
email: email,
|
|
||||||
emailVerified: new Date(),
|
|
||||||
password: hashSync('password'),
|
|
||||||
roles: [Role.USER],
|
|
||||||
},
|
|
||||||
update: {},
|
|
||||||
});
|
|
||||||
|
|
||||||
createdUsers.push(testUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
const team1 = await prisma.team.create({
|
|
||||||
data: {
|
|
||||||
name: 'Team 1',
|
|
||||||
url: 'team1',
|
|
||||||
ownerUserId: createdUsers[0].id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const team2 = await prisma.team.create({
|
|
||||||
data: {
|
|
||||||
name: 'Team 2',
|
|
||||||
url: 'team2',
|
|
||||||
ownerUserId: createdUsers[1].id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const team of [team1, team2]) {
|
|
||||||
await prisma.teamMember.createMany({
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
teamId: team.id,
|
|
||||||
userId: createdUsers[1].id,
|
|
||||||
role: TeamMemberRole.ADMIN,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
teamId: team.id,
|
|
||||||
userId: createdUsers[2].id,
|
|
||||||
role: TeamMemberRole.MEMBER,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user