psu-libraries / researcher-metadata

Penn State University's faculty and research metadata repository
https://metadata.libraries.psu.edu/
MIT License
7 stars 0 forks source link

Send email and update AI on deposit #879

Closed ajkiessl closed 1 year ago

ajkiessl commented 1 year ago

Implements mailer to send a confirmation message after deposit to the user that uploaded the Activity Insight OA File in Activity Insight. Also, enqueues a job to update the status of the post print file in Activity Insight to "Deposited to ScholarSphere".

One thing to note about this PR: I added a column to the ScholarsphereWorkDeposit model to store the associated activity_insight_oa_file_id. However, I did not add any foreign keys or model associations for this. I'm using this id to identify the file for the AiOAStatusExportJob that gets enqueued during the scholarsphere upload. I could just grab the ai_file_for_deposit on the publication there. However, there's a small chance this could change (a merge happens or the user uploads a new file). So for more precise record keeping, and to ensure the right record gets updated, I added activity_insight_oa_file_id directly to the deposit record. This could also be useful for troubleshooting when a deposit fails.

closes #796