From f9e5d57f0d2276eb669624b90349ba6a1393694a Mon Sep 17 00:00:00 2001 From: Simon Backx Date: Fri, 16 Sep 2022 11:13:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Added=20number=20formatting=20to?= =?UTF-8?q?=20members=20import=20email?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://ghost.slack.com/archives/C02G9E68C/p1663318892246929?thread_ts=1663317382.429489&cid=C02G9E68C --- ghost/members-importer/lib/email-template.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ghost/members-importer/lib/email-template.js b/ghost/members-importer/lib/email-template.js index 77a510656d..27a2e6f4ba 100644 --- a/ghost/members-importer/lib/email-template.js +++ b/ghost/members-importer/lib/email-template.js @@ -1,3 +1,7 @@ +function formatNumber(number) { + return number.toLocaleString(); +} + const iff = (cond, yes, no) => (cond ? yes : no); module.exports = ({result, siteUrl, membersUrl, emailRecipient}) => ` @@ -136,14 +140,14 @@ module.exports = ({result, siteUrl, membersUrl, emailRecipient}) => ` ${iff(result.imported > 0, ` -

A total of ${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.

+

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.`, `${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, `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.

`, '')}