Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Digest not merging email (or probably not working on docker self hosted) #6470

Open
2 tasks done
wankenooobi opened this issue Sep 10, 2024 · 3 comments
Open
2 tasks done
Labels

Comments

@wankenooobi
Copy link

📜 Description

Hi Team,

I wanted to bring to your attention a persistent issue with the email digest functionality, specifically its failure to merge consecutive emails within the designated timeframe.

I've reviewed existing reports, including the one found here:
Issue Link
, and I can consistently reproduce this bug using Docker Compose in versions 0.22, 0.23, 0.24, and the latest production tag. This issue appears to occur in both event and scheduled scenarios, suggesting that it may have been a long-standing problem or that I might be overlooking something.

For your reference, here is an example workflow used for testing the issue:
image

👟 Reproduction steps

Workflow Creation and Notification Process

1. Create a Workflow:

  • Follow the structure provided in the example workflow below:
    Workflow Example

2. Develop HTML Templates:

  • Create a set of HTML templates with varying content. For example:
<p>Welcome to our service!</p>
<p>Don't miss our latest updates!</p>

3. Define Simple HTML Custom Code Templates:

  • Use JavaScript to define simple HTML templates as follows:
const template1 = '<p>Your account is set up successfully!</p>';
const template2 = '<p>Your subscription will expire soon, please renew!</p>';

4. Send Notifications Using the Novu Node SDK:

  • Implement the following POST request for each template using the Novu Node SDK:
// Sending notification for template1
await novu.trigger(notificationWorkflowId, {
  to: {
    subscriberId: userId,
    email: '[email protected]'
  },
  payload: { html: template1 },
  overrides: {
    email: {
      subject: 'Your account setup is complete!',
    },
  }
});

// Sending notification for template2
await novu.trigger(notificationWorkflowId, {
  to: {
    subscriberId: userId,
    email: '[email protected]'
  },
  payload: { html: template2 },
  overrides: {
    email: {
      subject: 'Important: Renew your subscription!',
    },
  }
});

👍 Expected behavior

The digest should consolidate all email content into a single email message.

👎 Actual Behavior with Screenshots

In digest mode, only the initial email will be sent, disregarding any subsequent messages in the digest timeframe.

Novu version

versions 0.22, 0.23, 0.24, and the latest "prod" tag

npm version

docker npm version

node version

docker node version

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

@wankenooobi
Copy link
Author

additional: compose from https://docs.novu.co/community/deploy-with-docker

@jainpawan21
Copy link
Member

@wankenooobi

html is reserved variable, can you pleasetry with another variable like custom_html?

I see you are not following the digest template guide. Checkout this doc:
https://v0.x-docs.novu.co/workflows/digest#writing-digest-templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants