diff --git a/src/send-feed.ts b/src/send-feed.ts index 95f1ea2..09a0765 100644 --- a/src/send-feed.ts +++ b/src/send-feed.ts @@ -42,9 +42,12 @@ class SendFeed { try { const newResources: ResourceI[] = []; for (const resource of resources) { - resource.readLength = readingTime(resource.content || "").text - if (!resource.summary && resource.content) { - resource.summary = await this.summarizePost(resource.content); + resource.readLength = readingTime(resource.content || resource.description || "").text + if (!resource.summary && (resource.content || resource.description)) { + resource.summary = await this.summarizePost(resource.content ? + resource.content : + resource.description ? + resource.description : ""); resource.isUpdate = true; } newResources.push(resource) diff --git a/src/utils/email/generateEmailTemplate.ts b/src/utils/email/generateEmailTemplate.ts index ca3f26d..452ea77 100644 --- a/src/utils/email/generateEmailTemplate.ts +++ b/src/utils/email/generateEmailTemplate.ts @@ -26,8 +26,8 @@ const generatePost = (post: ResourceI, isSummaryEnabled: boolean) => ` ? post?.summary[0] === ":" ? "Summary" + post.summary : "Summary: " + post.summary - : post.description - : post.description}

+ : (post.content || post.description) + : (post.content || post.description)}