use html2text sending email

This commit is contained in:
les 2020-02-10 12:00:49 +01:00
parent a7a745e04f
commit e1046b49fc
7 changed files with 2 additions and 38 deletions

View file

@ -21,7 +21,7 @@ const mail = {
debug(`Send ${template} email to ${addresses}`)
const email = new Email({
views: { root: path.join(__dirname, '..', 'emails') },
htmlToText: false,
htmlToText: true,
juice: true,
juiceResources: {
preserveImportant: true,
@ -53,7 +53,7 @@ const mail = {
locals: {
...locales,
locale,
config: { title: config.title, baseurl: config.baseurl, description: config.description },
config: { title: config.title, baseurl: config.baseurl, description: config.description, admin_email: config.admin_email },
datetime: datetime => moment.unix(datetime).format('ddd, D MMMM HH:mm')
}
}

View file

@ -1,6 +0,0 @@
p= t('admin_register.content', { user, config })
hr
small #{config.title} / #{config.description}
br
small <a href="#{config.baseurl}">#{config.baseurl}</a>

View file

@ -1 +0,0 @@
p !{t('confirm.content', { config })}

View file

@ -1,21 +0,0 @@
extends ../layout.pug
block content
h3 #{event.title}
p Dove: #{event.place.name} - #{event.place.address}
p Quando: #{datetime(event.start_datetime)}
br
if event.image_path
<center>
<img style="height: 89vh; margin: 0 auto;" src="#{config.baseurl}/media/#{event.image_path}" />
</center>
p #{event.description}
each tag in event.tags
span ##{tag.tag}
br
<a href="#{config.baseurl}/event/#{event.id}">#{config.baseurl}/event/#{event.id}</a>
hr
if to_confirm
p Puoi confermare questo evento <a href="#{config.baseurl}/admin/confirm/#{event.id}">qui</a>
else
p Puoi eliminare queste notifiche <a href="#{config.baseurl}/del_notification/#{notification.remove_code}">qui</a>

View file

@ -1 +0,0 @@
p= !t('recover.content', {config, user})

View file

@ -1,6 +0,0 @@
p= t('register.content', { config, user })
hr
small #{config.title} / #{config.description}
br
small <a href="#{config.baseurl}">#{config.baseurl}</a>

View file

@ -1 +0,0 @@
p !{t('user_confirm.content', { config, user })}