@@ -952,7 +952,7 @@ def _vs_notification_scripts(self) -> DropdownChoice:
952
952
)
953
953
954
954
def _show_resulting_notifications (self , result : NotifyAnalysisInfo ) -> None :
955
- with table_element (table_id = "plugins" , title = _ ("Resulting notifications" )) as table :
955
+ with table_element (table_id = "plugins" , title = _ ("Predicted notifications" )) as table :
956
956
for contact , plugin , parameters , bulk in result [1 ]:
957
957
table .row ()
958
958
if contact .startswith ("mailto:" ):
@@ -1650,7 +1650,7 @@ def _show_notification_test_overview(
1650
1650
html .close_div ()
1651
1651
1652
1652
html .open_div (class_ = "message_container" )
1653
- html .h2 (_ ("Analysis results" ))
1653
+ html .h2 (_ ("Test results" ))
1654
1654
analyse_rules , analyse_resulting_notifications = analyse
1655
1655
match_count_all = len (tuple (entry for entry in analyse_rules if "match" in entry ))
1656
1656
match_count_user = len (
@@ -1682,20 +1682,39 @@ def _show_notification_test_overview(
1682
1682
)
1683
1683
)
1684
1684
html .br ()
1685
- resulting_notifications_count = len (analyse_resulting_notifications )
1685
+ resulting_notifications_count = len (analyse_resulting_notifications [ - 1 ][ 0 ]. split ( "," ) )
1686
1686
html .write_text_permissive (
1687
- ("%d resulting %s" )
1687
+ ("%d %s" )
1688
1688
% (
1689
1689
resulting_notifications_count ,
1690
1690
ungettext (
1691
- "notification" ,
1692
- "notifications" ,
1691
+ "notification would have been sent based on your notification rules (see table: 'Predicted notifications') " ,
1692
+ "notifications would have been sent based on your notification rules (see table: 'Predicted notifications') " ,
1693
1693
resulting_notifications_count ,
1694
1694
),
1695
1695
)
1696
1696
)
1697
- if request .var ("notify_plugin" ):
1698
- html .write_text_permissive (_ ("Notifications have been sent. " ))
1697
+ if dispatch_method := request .var ("dispatch" ):
1698
+ notifications_sent = [
1699
+ rule for rule in analyse_resulting_notifications if rule [1 ] == dispatch_method
1700
+ ]
1701
+ if notifications_sent :
1702
+ notification_sent_count = len (notifications_sent [- 1 ][0 ].split ("," ))
1703
+ else :
1704
+ notification_sent_count = 0
1705
+ html .br ()
1706
+ html .write_text_permissive (
1707
+ _ ("%d %s %s." )
1708
+ % (
1709
+ notification_sent_count ,
1710
+ self ._vs_notification_scripts ().value_to_html (dispatch_method ),
1711
+ ungettext (
1712
+ "notification has been sent out" ,
1713
+ "notifications have been sent out" ,
1714
+ notification_sent_count ,
1715
+ ),
1716
+ )
1717
+ )
1699
1718
html .br ()
1700
1719
html .br ()
1701
1720
html .write_text_permissive ("View the following tables for more details." )
0 commit comments