diff --git a/src/Jobs/Handler/SendNotification/Qualification.hs b/src/Jobs/Handler/SendNotification/Qualification.hs new file mode 100644 index 000000000..dfdf25cf5 --- /dev/null +++ b/src/Jobs/Handler/SendNotification/Qualification.hs @@ -0,0 +1,49 @@ +{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} -- ihamletFile discards do results + +module Jobs.Handler.SendNotification.Qualification + ( dispatchNotificationQualificationExpiry + , dispatchNotificationQualificationRenewal + ) where + +import Import + +{- +import Handler.Utils +import Jobs.Handler.SendNotification.Utils + +import Handler.Info (FAQItem(..)) + +import Text.Hamlet + +import qualified Database.Esqueleto.Experimental as E +import qualified Database.Esqueleto.Utils as E +-} + +dispatchNotificationQualificationExpiry :: QualificationId -> Day -> UserId -> Handler () +dispatchNotificationQualificationExpiry _nQualification _nExpiry _jRecipient = + error "dispatchNotificationQualificationExpiry not yet implemented TODO" +{- userMailT jRecipient $ do + (Allocation{..}, Course{..}, hasApplied) <- liftHandler . runDB $ (,,) + <$> getJust nAllocation + <*> getJust nCourse + <*> exists [CourseApplicationAllocation ==. Just nAllocation, CourseApplicationUser ==. jRecipient] + + replaceMailHeader "Auto-Submitted" $ Just "auto-generated" + setSubjectI $ MsgMailSubjectAllocationNewCourse allocationName + editNotifications <- mkEditNotifications jRecipient + + cID <- encrypt nCourse + mayApply <- lift $ orM + [ is _Authorized <$> evalAccessFor (Just jRecipient) (AllocationR allocationTerm allocationSchool allocationShorthand ARegisterR) True + , is _Authorized <$> evalAccessFor (Just jRecipient) (AllocationR allocationTerm allocationSchool allocationShorthand $ AApplyR cID) True + ] + + allocUrl <- toTextUrl $ AllocationR allocationTerm allocationSchool allocationShorthand AShowR :#: cID + + addHtmlMarkdownAlternatives $(ihamletFile "templates/mail/allocationNewCourse.hamlet") +-} + +dispatchNotificationQualificationRenewal :: QualificationId -> Day -> UserId -> Handler () +dispatchNotificationQualificationRenewal _nQualification _nExpiry _jRecipient = + error "dispatchNotificationQualificationRenewal not yet implemented TODO" + -- userMailT jRecipient $ do \ No newline at end of file