airbnb/knowledge-repo

Fix & improve subscription emails

jihonrado opened this issue · 2 comments

Context

When a new post is created within a tag, an email is sent to all users that are subscribed to that tag (if you have this functionality enabled). We have been testing this feature before using it in our production knowledge repo and found some issues.

Problems

  • The whole post is rendered and sent in the email, which is a problem per se if the post is too large. Besides, it is problematic when you have images, graphs and the like. What the receiver sees is a bunch of illegible code.

  • Images are "attached" using its base64 representation (<img src="data:image/png;base64,xxxxx" />), which is not supported by several email clients (including gmail, check this).

  • The receiver receives an email with the subject New knowledge post with tag [xxx]!, which on the one hand does not include the title of the post and on the other hand, it only shows a tag of the post (that could have many).

Proposed solution

  • Use a simplified version of the email which shows the TLDR instead of the whole post and include a link to the full article.
  • Include the post thumbnail as an attached image so there are no render issues in the different email clients.
  • Include more information in the email.

I will send a PR improving this very soon.

Done in #540