function formatNumber(number) {
return number.toLocaleString();
}
const iff = (cond, yes, no) => (cond ? yes : no);
module.exports = ({result, siteUrl, membersUrl, emailRecipient}) => `
|
|
${iff(result.imported > 0, `Your member import is complete`, `Your member import was unsuccessful`)}
|
${iff(result.imported === 0 && result.errors.length === 0, `
No members were added.
|
`, ``)}
${iff(result.imported > 0, `
A total of ${formatNumber(result.imported)} ${iff(result.imported === 1, 'person', 'people')} were successfully added or updated in your list of members, and now have access to your site.
|
`, ``)}
${iff(result.errors.length > 0, `
${iff(result.imported === 0, `No members were added.`, `${formatNumber(result.errors.length)} ${iff(result.errors.length === 1, `member was`, `members were`)} skipped due to errors.`)} There's a validated CSV file attached to this email with the list of errors so that you can fix them and re-upload the CSV to complete the import.
|
`, '')}
${iff(result.imported > 0, `View members`, `Try again`)}
|
|
|
|
|
`;