email template
This commit is contained in:
parent
ebbb582e99
commit
2451045693
15 changed files with 447 additions and 156 deletions
|
|
@ -131,10 +131,14 @@ export function validateImportRows(rows, { companyDomain, sendInvitation }) {
|
|||
seenEmails.add(workEmail);
|
||||
|
||||
const password = row.password.trim();
|
||||
if (!password) {
|
||||
rowErrors.push("Initial password is required.");
|
||||
} else if (!PASSWORD_PATTERN.test(password)) {
|
||||
rowErrors.push("Password must be at least 8 characters with upper, lower, and a number.");
|
||||
if (!sendInvitation) {
|
||||
if (!password) {
|
||||
rowErrors.push("Initial password is required.");
|
||||
} else if (!PASSWORD_PATTERN.test(password)) {
|
||||
rowErrors.push("Password must be at least 8 characters with upper, lower, and a number.");
|
||||
}
|
||||
} else if (password) {
|
||||
rowErrors.push("Password is not needed when sending invitation emails.");
|
||||
}
|
||||
|
||||
const invitationEmail = row.invitation_email.trim().toLowerCase();
|
||||
|
|
@ -171,7 +175,7 @@ export function rowsToImportPayload(rows, options) {
|
|||
? row.work_email.trim().toLowerCase()
|
||||
: `${row.work_email.trim().toLowerCase()}@${companyDomain}`,
|
||||
invitation_email: row.invitation_email.trim() || undefined,
|
||||
password: row.password.trim(),
|
||||
password: row.password.trim() || undefined,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue