topcoder-platform / tc-notifications

4 stars 15 forks source link

Empty emails #94

Open gondzo opened 5 years ago

gondzo commented 5 years ago

I still occasionally receive emails with only project name with no actual notifications inside, ex https://www.screencast.com/t/bTInb62Adh

@vikasrohit can you take a look at the email logs to check which events were sent there?

btw, maybe it would be a good idea to list all notification types covered by email templates and when sending an email log a warning or error if we run into a notification that doesn't have a template?

vikasrohit commented 5 years ago

@gondzo could you give me exact time stamp of the email?

gondzo commented 5 years ago

Mar 8, 2019, 02:00 EDT

gondzo commented 5 years ago

another idea for keeping track of these issues:

current templates are using a bunch of if statements to find the right template - we could use if/else if with a final else block that would render some error text. We could then render the template in our backend to check for error text and log it appropriately. This kind of defeats the purpose of having templates in sendgrid but is the only automated way I could think of to test if we're sending empty emails or not. what do you think @vikasrohit ?

vikasrohit commented 5 years ago

I think idea about having if-else-if instead of separate if-else blocks, might be good way to have some kind of differentiation between a valid email and an erroneous email. However, instead of rendering the template at backend, we can rather have a test account/email (or I can use mine real account as well) to receive all notification emails and then parse that email to look for the specific error message and act accordingly.

gondzo commented 5 years ago

that would work as well. any ideas for the error text to use? maybe a hidden div element so it's not visible to the actual recipients?

vikasrohit commented 5 years ago

Yes, we have to make it hidden either by making background and text color same OR actually setting visibility:hidden. Once it is hidden, we can use any error text. I would like to use constant style text for this e.g. NO_RENDERER_FOR_EVENT and we can append this text with actual event topic so that we can get all information from the template it self.

vikasrohit commented 5 years ago

@gondzo do you think you would be able to handle this?