@@ -699,14 +699,22 @@ userNotifyFeature ServerEnv{serverBaseURI, serverCron}
699
699
idx <- queryGetPackageIndex
700
700
revIdx <- liftIO queryReverseIndex
701
701
dependencyUpdateNotifications <- Map. unionsWith (++) <$> traverse (genDependencyUpdateList idx revIdx . pkgInfoToPkgId) revisionsAndUploads
702
- dependencyEmails <- Map. mapKeys fst <$> Map. traverseWithKey describeDependencyUpdate dependencyUpdateNotifications
702
+ dependencyEmails <- Map. traverseWithKey describeDependencyUpdate dependencyUpdateNotifications
703
703
704
704
-- Concat the constituent email parts such that only one email is sent per user
705
- mapM_ (sendNotifyEmailAndDelay users) . Map. toList $ foldr1 (Map. unionWith (++) ) $ [revisionUploadEmails, groupActionEmails, docReportEmails, tagProposalEmails]
705
+ mapM_ (sendNotifyEmailAndDelay users) . Map. toList $
706
+ fmap (" Maintainer Notifications" ,) . foldr1 (Map. unionWith (++) ) $
707
+ [ revisionUploadEmails
708
+ , groupActionEmails
709
+ , docReportEmails
710
+ , tagProposalEmails
711
+ ]
706
712
707
713
-- Dependency email notifications consist of multiple paragraphs, so it would be confusing if concatenated.
708
714
-- So they're sent independently.
709
- mapM_ (sendNotifyEmailAndDelay users) . Map. toList $ dependencyEmails
715
+ mapM_ (sendNotifyEmailAndDelay users) . Map. toList $
716
+ Map. mapKeys fst . Map. mapWithKey (\ (_, dep) ebody -> (" Dependency Update: " <> T. pack (display dep), ebody)) $
717
+ dependencyEmails
710
718
711
719
updateState notifyState (SetNotifyTime now)
712
720
@@ -862,8 +870,8 @@ userNotifyFeature ServerEnv{serverBaseURI, serverCron}
862
870
]
863
871
++ map display revDeps
864
872
865
- sendNotifyEmailAndDelay :: Users. Users -> (UserId , [String ]) -> IO ()
866
- sendNotifyEmailAndDelay users (uid, ebody) = do
873
+ sendNotifyEmailAndDelay :: Users. Users -> (UserId , ( T. Text , [String ]) ) -> IO ()
874
+ sendNotifyEmailAndDelay users (uid, (subject, ebody) ) = do
867
875
mudetails <- queryUserDetails uid
868
876
case mudetails of
869
877
Nothing -> return ()
@@ -872,8 +880,7 @@ userNotifyFeature ServerEnv{serverBaseURI, serverCron}
872
880
(T. pack (" noreply@" ++ uriRegName ourHost))
873
881
mail = (emptyMail mailFrom) {
874
882
mailTo = [Address (Just aname) eml],
875
- mailHeaders = [(BSS. pack " Subject" ,
876
- T. pack " [Hackage] Maintainer Notifications" )],
883
+ mailHeaders = [(BSS. pack " Subject" , " [Hackage] " <> subject)],
877
884
mailParts = [[Part (T. pack " text/plain; charset=utf-8" )
878
885
None DefaultDisposition []
879
886
(PartContent $ BS. pack $
0 commit comments