Skip to content

Commit

Permalink
Merge pull request #17 from dabigjoe6/email
Browse files Browse the repository at this point in the history
Fix email
  • Loading branch information
dabigjoe6 authored Jul 8, 2023
2 parents 09ce68a + 07d2c06 commit 74c5323
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/email/generateEmailTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const generatePost = (post: ResourceI, isSummaryEnabled: boolean) => `
</tr>
<tr>
<td class="v-container-padding-padding" style="overflow-wrap:break-word;word-break:break-word;padding:0px 10px 10px;font-family:trebuchet ms,geneva;" align="left">
<p class="v-text-align v-line-height" style="margin: 0px; line-height: 110%; text-align: left; word-wrap: break-word; font-weight: normal; font-family: 'Open Sans',sans-serif; font-size: 16px; color: #747474;">${post.authorsName ? "<small>" + post.authorsName + "</small>" : ""}${post.datePublished ? "<small> | " + moment(post.datePublished).format('D MMM, YYYY') + "</small>" : ""}${post.readLength ? "<small> | " + post.readLength + "</small>" : ""}</p>
<p class="v-text-align v-line-height" style="margin: 0px; line-height: 110%; text-align: left; word-wrap: break-word; font-weight: normal; font-family: 'Open Sans',sans-serif; font-size: 16px; color: #747474;"><small>${post.authorsName ? post.authorsName : ""}${((post.authorsName && post.datePublished) || (post.authorsName && post.readLength)) ? " | " : ""}${post.datePublished ? moment(post.datePublished).format('D MMM, YYYY') : ""}${(post.datePublished && post.readLength) ? " | " : ""}${post.readLength ? post.readLength : ""}</small></p>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -50,7 +50,7 @@ const generatePost = (post: ResourceI, isSummaryEnabled: boolean) => `
</table>`;

const generateEmailTemplate = (posts: ResourceI[], latestPosts: ResourceI[], isSummaryEnabled: boolean) => {
if (posts && posts.length > 0) {
if ((posts && posts.length > 0) || (latestPosts && latestPosts.length > 0)) {
let postsHTML = "";
let latestPostsHTML = "";

Expand Down

0 comments on commit 74c5323

Please sign in to comment.