2022-09-16 12:13:12 +03:00
function formatNumber ( number ) {
return number . toLocaleString ( ) ;
}
2020-12-09 19:09:24 +03:00
const iff = ( cond , yes , no ) => ( cond ? yes : no ) ;
module . exports = ( { result , siteUrl , membersUrl , emailRecipient } ) => `
< ! doctype html >
< html >
< head >
< meta name = "viewport" content = "width=device-width" >
< meta http - equiv = "Content-Type" content = "text/html; charset=UTF-8" >
< title > Your member import is complete < / t i t l e >
< style >
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RESPONSIVE AND MOBILE FRIENDLY STYLES
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * /
@ media only screen and ( max - width : 620 px ) {
table [ class = body ] h1 {
font - size : 28 px ! important ;
margin - bottom : 10 px ! important ;
}
table [ class = body ] p ,
table [ class = body ] ul ,
table [ class = body ] ol ,
table [ class = body ] td ,
table [ class = body ] span ,
table [ class = body ] a {
font - size : 16 px ! important ;
}
table [ class = body ] . title {
font - size : 22 px ! important ;
}
table [ class = body ] . wrapper ,
table [ class = body ] . article {
padding : 10 px ! important ;
}
table [ class = body ] . content {
padding : 0 ! important ;
}
table [ class = body ] . container {
padding : 0 ! important ;
width : 100 % ! important ;
}
table [ class = body ] . main {
border - left - width : 0 ! important ;
border - radius : 0 ! important ;
border - right - width : 0 ! important ;
}
table [ class = body ] . btn table {
width : 100 % ! important ;
}
table [ class = body ] . btn a {
width : 100 % ! important ;
}
table [ class = body ] . img - responsive {
height : auto ! important ;
max - width : 100 % ! important ;
width : auto ! important ;
}
table [ class = body ] p [ class = small ] ,
table [ class = body ] a [ class = small ] {
font - size : 12 x ! important ;
}
}
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PRESERVE THESE STYLES IN THE HEAD
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * /
@ media all {
. ExternalClass {
width : 100 % ;
}
. ExternalClass ,
. ExternalClass p ,
. ExternalClass span ,
. ExternalClass font ,
. ExternalClass td ,
. ExternalClass div {
line - height : 100 % ;
}
. recipient - link a {
color : inherit ! important ;
font - family : inherit ! important ;
font - size : inherit ! important ;
font - weight : inherit ! important ;
line - height : inherit ! important ;
text - decoration : none ! important ;
}
# MessageViewBody a {
color : inherit ;
text - decoration : none ;
font - size : inherit ;
font - family : inherit ;
font - weight : inherit ;
line - height : inherit ;
}
}
hr {
border - width : 0 ;
height : 0 ;
margin - top : 34 px ;
margin - bottom : 34 px ;
border - bottom - width : 1 px ;
border - bottom - color : # EEF5F8 ;
}
a {
color : # 3 A464C ;
}
< / s t y l e >
< / h e a d >
< body class = "" style = "background-color: #ffffff; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.5em; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;" >
< table border = "0" cellpadding = "0" cellspacing = "0" class = "body" style = "border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" >
< tr >
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top;" > & nbsp ; < / t d >
< td class = "container" style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top; display: block; Margin: 0 auto; max-width: 540px; padding: 10px; width: 540px;" >
< div class = "content" style = "box-sizing: border-box; display: block; Margin: 0 auto; max-width: 600px; padding: 30px 20px;" >
<!-- START CENTERED CONTAINER -- >
< span class = "preheader" style = "color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;" > Your member import is complete < / s p a n >
< table class = "main" style = "border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; background: #ffffff; border-radius: 8px;" >
<!-- START MAIN CONTENT AREA -- >
< tr >
< td class = "wrapper" style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top; box-sizing: border-box;" >
< table border = "0" cellpadding = "0" cellspacing = "0" style = "border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;" >
< tr >
2021-03-18 20:27:27 +03:00
< td align = "center" style = "padding-top: 20px; padding-bottom: 12px;" > < img src = "https://static.ghost.org/v4.0.0/images/ghost-orb-4.png" width = "60" height = "60" style = "width: 60px; height: 60px;" / > < / t d >
2020-12-09 19:09:24 +03:00
< / t r >
< tr >
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; vertical-align: top;" >
2022-09-16 11:45:47 +03:00
< p class = "title" style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 21px; color: #3A464C; font-weight: normal; line-height: 25px; margin-bottom: 30px; margin-top: 50px; font-weight: 600; color: #15212A;" > $ { iff ( result . imported > 0 , ` Your member import is complete ` , ` Your member import was unsuccessful ` ) } < / p >
2020-12-09 19:09:24 +03:00
< / t d >
< / t r >
$ { iff ( result . imported === 0 && result . errors . length === 0 , `
< tr >
2022-09-16 11:45:47 +03:00
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top; padding-bottom: 16px;" >
2020-12-09 19:09:24 +03:00
< p style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; color: #3A464C; font-weight: normal; margin: 0; line-height: 25px; margin-bottom: 0px;" > No members were added . < / p >
< / t d >
< / t r >
` , ` ` )}
$ { iff ( result . imported > 0 , `
< tr >
2022-09-16 11:45:47 +03:00
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top; padding-bottom: 16px;" >
2022-09-16 12:13:12 +03:00
< p style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; color: #3A464C; font-weight: normal; margin: 0; line-height: 25px; margin-bottom: 0px;" > A total of < strong style = "font-weight: 600;" > $ { formatNumber ( result . imported ) } < / s t r o n g > $ { i f f ( r e s u l t . i m p o r t e d = = = 1 , ' p e r s o n ' , ' p e o p l e ' ) } w e r e s u c c e s s f u l l y a d d e d o r u p d a t e d i n y o u r l i s t o f m e m b e r s , a n d n o w h a v e a c c e s s t o y o u r s i t e . < / p >
2020-12-09 19:09:24 +03:00
< / t d >
< / t r > ` , ` ` ) }
$ { iff ( result . errors . length > 0 , `
< tr >
2022-09-16 11:45:47 +03:00
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top; padding-bottom: 16px;" >
2020-12-09 19:09:24 +03:00
< p style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; color: #3A464C; font-weight: normal; margin: 0; line-height: 25px; margin-bottom: 0px;" >
2022-09-16 12:13:12 +03:00
$ { iff ( result . imported === 0 , ` No members were added. ` , ` <strong style="font-weight: 600;"> ${ formatNumber ( result . errors . length ) } </strong> ${ 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 . < / p >
2020-12-09 19:09:24 +03:00
< / t d >
< / t r > ` , ' ' ) }
< tr >
2022-09-16 11:45:47 +03:00
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top; padding-bottom: 12px; padding-top: 16px;" >
2020-12-10 14:19:26 +03:00
< a href = "${membersUrl.href}" target = "_blank" style = "display: inline-block; color: #ffffff; background-color: #15212A; border: solid 1px #15212A; border-radius: 5px; box-sizing: border-box; cursor: pointer; text-decoration: none; font-size: 16px; font-weight: normal; margin: 0; padding: 9px 22px 10px; border-color: #15212A;" > $ { iff ( result . imported > 0 , ` View members ` , ` Try again ` ) } < / a >
2020-12-09 19:09:24 +03:00
< / t d >
< / t r >
< / t a b l e >
< / t d >
< / t r >
< tr >
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; vertical-align: top; padding-top: 80px; padding-bottom: 10px;" >
< div class = "footer" >
< p class = "small" style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; color: #738A94; font-weight: normal; margin: 0; line-height: 18px; margin-bottom: 0px; font-size: 11px;" > This email was sent from < a href = "${siteUrl.href}" style = "color: #738A94;" > $ { siteUrl . host } < / a > t o < a h r e f = " m a i l t o : $ { e m a i l R e c i p i e n t } " s t y l e = " c o l o r : # 7 3 8 A 9 4 ; " > $ { e m a i l R e c i p i e n t } < / a > < / p >
< / d i v >
< / t d >
< / t r >
<!-- END MAIN CONTENT AREA -- >
< / t a b l e >
<!-- END CENTERED CONTAINER -- >
< / d i v >
< / t d >
< td style = "font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; vertical-align: top;" > & nbsp ; < / t d >
< / t r >
< / t a b l e >
< / b o d y >
< / h t m l >
` ;