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

📬 Notification emails unwanted threading #18

Open
ryanburnette opened this issue Jun 20, 2021 · 4 comments
Open

📬 Notification emails unwanted threading #18

ryanburnette opened this issue Jun 20, 2021 · 4 comments

Comments

@ryanburnette
Copy link
Collaborator

This isn't in the library, but it's relevant.

I have still never figured out how to add a header to emails to separate the threads. I'm still including a portion of my secret in the subject line to keep subsequent notify emails from threading.

If you solve this problem, please show me how you did it.

@ryanburnette ryanburnette changed the title Notification emails Notification emails unwanted threading Jun 20, 2021
@coolaj86
Copy link
Contributor

coolaj86 commented Jun 22, 2021

I'm glad you asked. This was a good find:

These alone won't do:

request({
  url: `https://api.mailgun.net/v3/${domain}/messages`,
  auth: `api:${apiKey}`,
  form: {
    from: "[email protected]",
    "h:Reply-To": "[email protected]",
    "h:Message-ID": rnd() + "@msgs.rootprojects.org",
    "h:X-Entity-Ref-ID": rnd() + "@msgs.rootprojects.org",
    "h:References": rnd() + "@msgs.rootprojects.org",
    to: "[email protected]",
    subject: "Hey Now, Hey Now",
    html: `${preHeader}<p>Don't thread this over.</p>`,
    text: "Don't thread this over.",
  },
})

@ryanburnette
Copy link
Collaborator Author

This one deserves its own video.

@coolaj86 coolaj86 changed the title Notification emails unwanted threading 📬 Notification emails unwanted threading Jun 22, 2021
@ryanburnette
Copy link
Collaborator Author

It works!

@coolaj86
Copy link
Contributor

Added to https://therootcompany.com/blog/send-email-with-mailgun-and-nodejs/

Leaving open because this might make for a good video tonight.

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

No branches or pull requests

2 participants