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 Import
|
||||||
|
|
||||||
import Utils.Lens
|
import Utils.Lens
|
||||||
import Handler.Utils.DateTime
|
import Handler.Utils
|
||||||
import Handler.Utils.Mail
|
|
||||||
import Jobs.Handler.SendNotification.Utils
|
import Jobs.Handler.SendNotification.Utils
|
||||||
|
|
||||||
import Text.Hamlet
|
import Text.Hamlet
|
||||||
@ -23,6 +22,9 @@ dispatchNotificationSubmissionRated nSubmission jRecipient = userMailT jRecipien
|
|||||||
course <- belongsToJust sheetCourse sheet
|
course <- belongsToJust sheetCourse sheet
|
||||||
corrector <- traverse getJust submissionRatingBy
|
corrector <- traverse getJust submissionRatingBy
|
||||||
return (course, sheet, submission, corrector)
|
return (course, sheet, submission, corrector)
|
||||||
|
|
||||||
|
whenIsJust corrector $ \corrector' ->
|
||||||
|
addMailHeader "Reply-To" . renderAddress $ userAddress corrector'
|
||||||
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
|
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
|
||||||
setSubjectI $ MsgMailSubjectSubmissionRated courseShorthand
|
setSubjectI $ MsgMailSubjectSubmissionRated courseShorthand
|
||||||
|
|
||||||
@ -45,7 +47,13 @@ dispatchNotificationSubmissionRated nSubmission jRecipient = userMailT jRecipien
|
|||||||
, "submission-rating-points" Aeson..= (guard (sheetType /= NotGraded) *> submissionRatingPoints)
|
, "submission-rating-points" Aeson..= (guard (sheetType /= NotGraded) *> submissionRatingPoints)
|
||||||
, "submission-rating-comment" Aeson..= submissionRatingComment
|
, "submission-rating-comment" Aeson..= submissionRatingComment
|
||||||
, "submission-rating-time" Aeson..= submissionRatingTime
|
, "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)
|
, "submission-rating-passed" Aeson..= join (gradingPassed <$> sheetType ^? _grading <*> submissionRatingPoints)
|
||||||
, "sheet-name" Aeson..= sheetName
|
, "sheet-name" Aeson..= sheetName
|
||||||
, "sheet-type" Aeson..= sheetType
|
, "sheet-type" Aeson..= sheetType
|
||||||
|
|||||||
@ -3,10 +3,10 @@
|
|||||||
<tr .table__row>
|
<tr .table__row>
|
||||||
<th .table__th>_{MsgSubmission}
|
<th .table__th>_{MsgSubmission}
|
||||||
<td .table__td>#{cid}
|
<td .table__td>#{cid}
|
||||||
$maybe Entity _ User{userDisplayName} <- corrector
|
$maybe Entity _ User{userDisplayName, userSurname, userEmail} <- corrector
|
||||||
<tr .table__row>
|
<tr .table__row>
|
||||||
<th .table__th>_{MsgRatingBy}
|
<th .table__th>_{MsgRatingBy}
|
||||||
<td .table__td>#{userDisplayName}
|
<td .table__td>^{nameEmailWidget userEmail userDisplayName userSurname}
|
||||||
$maybe time <- submissionRatingTime
|
$maybe time <- submissionRatingTime
|
||||||
<tr .table__row>
|
<tr .table__row>
|
||||||
<th .table__th>_{MsgRatingTime}
|
<th .table__th>_{MsgRatingTime}
|
||||||
|
|||||||
@ -23,11 +23,11 @@ $newline never
|
|||||||
<dd>
|
<dd>
|
||||||
<a href=@{CSubmissionR tid ssh csh shn csid SubShowR}>
|
<a href=@{CSubmissionR tid ssh csh shn csid SubShowR}>
|
||||||
#{csid}
|
#{csid}
|
||||||
$maybe User{userDisplayName} <- corrector
|
$maybe User{userDisplayName, userSurname, userEmail} <- corrector
|
||||||
<dt>
|
<dt>
|
||||||
_{MsgRatingBy}
|
_{MsgRatingBy}
|
||||||
<dd>
|
<dd>
|
||||||
#{userDisplayName}
|
#{nameEmailHtml userEmail userDisplayName userSurname}
|
||||||
$maybe time <- submissionRatingTime'
|
$maybe time <- submissionRatingTime'
|
||||||
<dt>
|
<dt>
|
||||||
_{MsgRatingTime}
|
_{MsgRatingTime}
|
||||||
|
|||||||
Reference in New Issue
Block a user