mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #2097 from omnivore-app/fix/unsubscribe-header
Fix list-unsubscribe header undefined
This commit is contained in:
commit
c3366c6238
2 changed files with 12 additions and 6 deletions
|
|
@ -172,9 +172,9 @@ export abstract class ContentHandler {
|
|||
const url =
|
||||
(await this.parseNewsletterUrl(headers, html)) || generateUniqueUrl()
|
||||
const author = this.parseAuthor(from)
|
||||
const unsubscribe = this.parseUnsubscribe(
|
||||
headers['list-unsubscribe']?.toString()
|
||||
)
|
||||
const unsubscribe = headers['list-unsubscribe']
|
||||
? this.parseUnsubscribe(headers['list-unsubscribe'].toString())
|
||||
: undefined
|
||||
|
||||
return {
|
||||
email: to,
|
||||
|
|
@ -182,8 +182,8 @@ export abstract class ContentHandler {
|
|||
url,
|
||||
title: subject,
|
||||
author,
|
||||
unsubMailTo: unsubscribe.mailTo || '',
|
||||
unsubHttpUrl: unsubscribe.httpUrl || '',
|
||||
unsubMailTo: unsubscribe?.mailTo || '',
|
||||
unsubHttpUrl: unsubscribe?.httpUrl || '',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,7 +189,13 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
|
|||
})
|
||||
res.send('newsletter received')
|
||||
} catch (error) {
|
||||
console.log('error handling emails, will forward.', from, to, subject)
|
||||
console.log(
|
||||
'error handling emails, will forward.',
|
||||
from,
|
||||
to,
|
||||
subject,
|
||||
error
|
||||
)
|
||||
// queue error emails
|
||||
await pubsub.topic(NON_NEWSLETTER_EMAIL_TOPIC).publishMessage({
|
||||
json: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue