diff --git a/src/Jobs/Handler/SendNotification/SubmissionRated.hs b/src/Jobs/Handler/SendNotification/SubmissionRated.hs index 75314e786..ff9a45f5a 100644 --- a/src/Jobs/Handler/SendNotification/SubmissionRated.hs +++ b/src/Jobs/Handler/SendNotification/SubmissionRated.hs @@ -7,8 +7,7 @@ module Jobs.Handler.SendNotification.SubmissionRated import Import import Utils.Lens -import Handler.Utils.DateTime -import Handler.Utils.Mail +import Handler.Utils import Jobs.Handler.SendNotification.Utils import Text.Hamlet @@ -23,6 +22,9 @@ dispatchNotificationSubmissionRated nSubmission jRecipient = userMailT jRecipien course <- belongsToJust sheetCourse sheet corrector <- traverse getJust submissionRatingBy return (course, sheet, submission, corrector) + + whenIsJust corrector $ \corrector' -> + addMailHeader "Reply-To" . renderAddress $ userAddress corrector' replaceMailHeader "Auto-Submitted" $ Just "auto-generated" setSubjectI $ MsgMailSubjectSubmissionRated courseShorthand @@ -45,7 +47,13 @@ dispatchNotificationSubmissionRated nSubmission jRecipient = userMailT jRecipien , "submission-rating-points" Aeson..= (guard (sheetType /= NotGraded) *> submissionRatingPoints) , "submission-rating-comment" Aeson..= submissionRatingComment , "submission-rating-time" Aeson..= submissionRatingTime - , "submission-rating-by" Aeson..= (userDisplayName <$> corrector) + , (Aeson..=) "submission-rating-by" $ do + corrector' <- corrector + return $ Aeson.object + [ "display-name" Aeson..= userDisplayName corrector' + , "surname" Aeson..= userSurname corrector' + , "email" Aeson..= userEmail corrector' + ] , "submission-rating-passed" Aeson..= join (gradingPassed <$> sheetType ^? _grading <*> submissionRatingPoints) , "sheet-name" Aeson..= sheetName , "sheet-type" Aeson..= sheetType diff --git a/templates/correction-user.hamlet b/templates/correction-user.hamlet index 78a4533b2..252b9d046 100644 --- a/templates/correction-user.hamlet +++ b/templates/correction-user.hamlet @@ -3,10 +3,10 @@