Erudika / scoold-pro

Cloud-ready Q&A platform for the enterprise (self-hosted, on premise)
https://scoold.com
Other
7 stars 0 forks source link

Unexpected behavior with E-Mail notifications #30

Closed b-morgenthaler closed 4 years ago

b-morgenthaler commented 4 years ago

Hi, we are currently using

Scoold Pro Scoold version: 1.37.1 Production mode: true Para app: app:scoold Para version: 1.35.0 Para endpoint: http://localhost:8080

Our E-Mail notification is configued like this

para_mention_emails_controlled_by_admins: | true para_summary_email_items: | 25 para_summary_email_period_days: | 1 para_summary_email_controlled_by_admins: | true

Context: User "cc user" posted a new question within an "evaluation" space which I am in as well.

The first E-Mail I received was because I enabled to be notified whenever a new question has been posted:

E-Mail_new_question_posted

Please note that the user name in "An" (To:) field is not my name. I assume that everybody else is on Bcc. But it could be my name here instead of another valid user who has activated E-Mail notification on new questions.

The second E-Mail I received for the very same question was from the summary notification which admin enabled for all users:

E-Mail_summary_1st_time

This time the user in "An" is the expected one (me) but the content of the E-Mail changed: it looks as if I had asked the question and not "cc user".

Then I received another summary E-Mail which is also unexpected because this question was part of the first summary E-Mail already:

E-Mail_summary_2nd_time

Looking at the timestamp of the received E-Mails there were no 24 hrs in between the two summary E-Mails.

Did we miss anything with configuration or is this a defective behavior?

Thanks and regards, Björn

albogdano commented 4 years ago

Thanks for the detailed report Björn! I'll investigate this issue later today and try to fix it as soon as I can.

albogdano commented 4 years ago

I don't quite understand what you mean in the last few sentences. The first email has a timestamp 03.03.2020 14:34 and the second is 04.03.2020 23:11. This is more than 24 hours. Also if you have restarted Scoold in that period of time, the starting point from which the periodic task begins is changed so that explains the longer time frame between the two emails.

Secondly, I don't know which email client is that but Scoold does not include names in the "To:" field, only emails, i.e. the field is not personalized in any way. I use Thunderbird and I don't see a name in the To: field. Can you check the email source to confirm this?

albogdano commented 4 years ago

I was only able to fix the bug where question authors are the same as the person receiving the summary email.

b-morgenthaler commented 4 years ago

Thanks for looking into this so fast and fixing one of the issues!

Regarding E-Mail timestamp: I guess this was not a very good explanation, I'll give it another try: the first summary E-Mail from 3.3.2020 14:34 included the same question as the second summary E-Mail from 4.3.2020 23:11. My understanding of the feature "summary E-Mail for new questions" is that questions that has been included in one summary E-Mail would not show up in subsequent ones (hence from the perspective of the subsequent summary E-Mail the question is not new anymore). But I think there could be a different definition of "new" as in "visited by the user"?

Regarding names in "To:": the E-Mail client is Outlook from Microsoft Office. And the name actually is the E-Mail address. Outlook maps the name from its address book if the E-Mail address is known. So, please consider the name as the E-Mail address :-). The unexpected behavior here from my perspective is, that in the E-Mail notification for new questions (not the summary E-Mail) there is a different E-Mail address other than mine in to To: field. The E-Mail (aka name) shown in the picture is the E-Mail from a different Scoold user who seems to get notified for new questions as well. All other recipients (including me) seem to be in Bcc because there is no other E-Mail address in the E-Mail header.

I hope this clears things a bit :-)

albogdano commented 4 years ago

In the case where there were no new questions posted in the last 24 hours, no summary email will be sent and the next check will be in 6 hours time. If after 24+6 hours a new question gets posted, it will be added to the email summary and sent. I've tweaked the periodic task a bit to get around that problem with old questions reappearing in the next summary. I still have to do some more testing.

Yes, the emailing code in Scoold uses BCC and yes, that is a bug which I've just noticed and fixed. So, thank you! :)