fix(corrections): properly link corrector emails
This commit is contained in:
parent
c19ced5302
commit
93855957e6
@ -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
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
<tr .table__row>
|
||||
<th .table__th>_{MsgSubmission}
|
||||
<td .table__td>#{cid}
|
||||
$maybe Entity _ User{userDisplayName} <- corrector
|
||||
$maybe Entity _ User{userDisplayName, userSurname, userEmail} <- corrector
|
||||
<tr .table__row>
|
||||
<th .table__th>_{MsgRatingBy}
|
||||
<td .table__td>#{userDisplayName}
|
||||
<td .table__td>^{nameEmailWidget userEmail userDisplayName userSurname}
|
||||
$maybe time <- submissionRatingTime
|
||||
<tr .table__row>
|
||||
<th .table__th>_{MsgRatingTime}
|
||||
|
||||
@ -23,11 +23,11 @@ $newline never
|
||||
<dd>
|
||||
<a href=@{CSubmissionR tid ssh csh shn csid SubShowR}>
|
||||
#{csid}
|
||||
$maybe User{userDisplayName} <- corrector
|
||||
$maybe User{userDisplayName, userSurname, userEmail} <- corrector
|
||||
<dt>
|
||||
_{MsgRatingBy}
|
||||
<dd>
|
||||
#{userDisplayName}
|
||||
#{nameEmailHtml userEmail userDisplayName userSurname}
|
||||
$maybe time <- submissionRatingTime'
|
||||
<dt>
|
||||
_{MsgRatingTime}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user