-
Couldn't load subscription status.
- Fork 7
Related papers notification #886
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
Conversation
Details: - This is currently a prototype. - A new email template type is defined as `relatedPaperNotification`. - The emails are triggered whenever the related papers are updated for a document. - A new metadata field is available on a document. `doc.relatedPapersNotified()` can be used to set or get whether the notifications have been sent. This prevents duplicates. - Novel interactions are an optional enhancement in the emails: An author can receive an email whether or not the originating factoid has a novel interaction. However, if there is a novel interaction, this should be mentioned in the email. - Currently, only notifications are sent to the terminal. The emails are disabled until the template is set up. - Action items are marked by `// TODO RPM` Action items: - [ ] Add a template to Mailjet (@jvwong), based on our email document on Google Docs. - [ ] Reuse our Indra querying code to determine whether there is a novel interaction -- i.e. an interaction that has zero results in Indra (@metincansiper). - [ ] Verify that our emails send correctly on unstable. We'll temporary set unstable to send these notifications to Max and Jeff (@maxkfranz @jvwong). - [ ] Finalise the email template text (@maxkfranz). - [ ] Research the feasibility of the bonus 'factoidable' nudge: Can we determine using AI whether a paper is a good candidate for Biofactoid? Ref. : Novel interaction notification #858
|
Note: The linting errors will show you the main places that still need to be updated. |
|
I had one refinement for the pool of papers used to select authors to contact: factoid/src/server/routes/api/document/index.js Line 1268 in 715ede0
Document-level ( A subset of the raw set of ELINK articles retrieved consist of:
So the idea is to select from these incoming and outgoing articles for authors to contact. There's a few reasons to select these:
|
|
Great points, Jeff. Re.:
This applies to the bonus nudge, but we can still notify authors of papers that aren't good candidates to be deposited. Emails for those papers would exclude the nudge, but those emails would still help to increase mindshare for Biofactoid. |
|
Template info: |
- Accept an optional filter for linknames
…he 'getRelPprsForDoc'
|
So I'm setting a new document attribute
|
This should only get triggered at the same time as related papers are saved (or refreshed). That should be done on submission, not on creation. Was there a reason for changing the related papers behaviour to search on creation? Alternatively, |
|
Re.
It's not absolutely necessary to have this feature for an initial version of the notifications, but it would be great in future iterations to vary the email template based on this factor. @metincansiper, would it be possible to use a metadata field (e.g. |
I retrieve document-level related papers on creations, because they are drawn from PubMed, and so that there was something to show in the explorer-view immediately post-submit (in fact, on create). |
…g switched to 'public', following submission - EMAIL_RELPPRS_CONTACT config that flags whether the relatedPapersEmails should be sent to contacts (default true)
|
OK two updates:
|
OK, I had it together with getting the related papers so that the admin UI could just refresh things with the existing refresh button. In case of an Indra failure, for example, the related papers may not exist and the emails would never be sent. The refresh button would allow for both of those to recover, and the related papers refreshing should already be integrated into the admin panel. The new approach is fine, but the admin UI would now need to explicitly send these emails on refresh (if the sent flag is false). |
@maxkfranz I made the requested change in novel_intn branch (https://github.com/PathwayCommons/factoid/tree/novel_intn). Should I make a PR to your branch used in this PR? BTW I considered when an interaction has no result right after the query made for the interaction. Later, the interactions with not enough result are assigned with some random results from the document. I did not consider that step since I think that any interaction will not be novel in that sense as long as the document has enough results. |
Oh I see now. If you want it tied to the existing admin refresh, i can do that by adding it below this: factoid/src/server/routes/api/document/index.js Line 1541 in 062ee8c
|
|
Sounds good
… On Nov 9, 2020, at 14:51, Jeffrey ***@***.***> wrote:
Put the code for sending these emails in the set of post-public actions to take (tweet, updated related papers, send follow up emails).
OK, I had it together with getting the related papers so that the admin UI could just refresh things with the existing refresh button. In case of an Indra failure, for example, the related papers may not exist and the emails would never be sent. The refresh button would allow for both of those to recover, and the related papers refreshing should already be integrated into the admin panel.
The new approach is fine, but the admin UI would now need to explicitly send these emails on refresh (if the sent flag is false).
Oh I see now. If you want it tied to the existing admin refresh, i can do that by adding it below this:
https://github.com/PathwayCommons/factoid/blob/062ee8cd52de38679d4db68c72614f30c761ee3e/src/server/routes/api/document/index.js#L1541 <https://github.com/PathwayCommons/factoid/blob/062ee8cd52de38679d4db68c72614f30c761ee3e/src/server/routes/api/document/index.js#L1541>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#886 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAHRO47HHIZGKHG4KY5KD6DSPBB45ANCNFSM4TCRZ5DQ>.
|
@metincansiper, it's fine to just cherry-pick your commits into this branch. |
|
This branch is now ready to be merged for testing on the unstable instance. |
|
@jvwong, you can either merge this in now or wait for @metincansiper to add his commits re. Indra. If you want to merge sooner, @metincansiper could add his changes in a separate PR. |
@metincansiper can you add your commits to this branch? |
|
@jvwong I added my commit into this branch |
…ailRelatedPaperAuthors()` re. `doc.relatedPapersNotified()`
|
OK, should be good to go |
|
This is throwing some error on build: |
|
For now, you could remove winston from However,
|
|
I was noticing that right now. I'm going to move it now. |
|
Clarification: I'm moving email.js only. |
Details:
relatedPaperNotification.doc.relatedPapersNotified()can be used to set or get whether the notifications have been sent. This prevents duplicates.// TODO RPMAction items:
Ref. : Novel interaction notification #858