Repository: mage-ai/mage-ai

Issue:
[BUG] Teams notifications' title is not read from config
### Mage version

0.9.76

### Describe the bug

In `sender.py`, the notification's title for Teams is not pass as parameter to `send_teams_message`, thus the notifications' title cannot be override from configuration and still show the default one: "Mage pipeline run status logs"

### To reproduce

1. In `metadata.yaml` add notification config for Teams
```yaml
notification_config:
  alert_on:
  - trigger_failure
  - trigger_passed_sla
  - trigger_success
  teams_config:
    webhook_url: "{{ env_var('MAGE_TEAMS_WEBHOOK_URL') }}"
  message_templates:
    success:
      title: "My custom title"
      summary: "My custom summary"
```
2. Run a pipeline


### Expected behavior

Title and summary of the notification should show the same text defined in config

### Screenshots

Current behavior
![Image](https://github.com/user-attachments/assets/4adea350-e7f6-473d-acea-341f04dd2d4e)

### Operating system

_No response_

### Additional context

_No response_

Discussion:
@csharplus: This issue has been resolved by the fix in https://github.com/mage-ai/mage-ai/pull/5788.

Solution patch:
diff --git a/mage_ai/orchestration/notification/sender.py b/mage_ai/orchestration/notification/sender.py
index 67440c8b6..4e92e27ea 100644
--- a/mage_ai/orchestration/notification/sender.py
+++ b/mage_ai/orchestration/notification/sender.py
@@ -69,7 +69,7 @@ class NotificationSender:
 
         if self.config.teams_config is not None and self.config.teams_config.is_valid:
             try:
-                send_teams_message(self.config.teams_config, summary)
+                send_teams_message(self.config.teams_config, summary, title)
             except Exception:
                 traceback.print_exc()
 
@@ -87,7 +87,7 @@ class NotificationSender:
 
         if self.config.google_chat_config is not None and self.config.google_chat_config.is_valid:
             try:
-                send_google_chat_message(self.config.google_chat_config, summary)
+                send_google_chat_message(self.config.google_chat_config, summary, title)
             except Exception:
                 traceback.print_exc()
 


Test patch:
diff --git a/mage_ai/tests/orchestration/notification/test_sender.py b/mage_ai/tests/orchestration/notification/test_sender.py
index a65fc96b6..eb6ab8af5 100644
--- a/mage_ai/tests/orchestration/notification/test_sender.py
+++ b/mage_ai/tests/orchestration/notification/test_sender.py
@@ -112,9 +112,11 @@ class NotificationSenderTests(DBTestCase):
             f'`{pipeline_run.pipeline_schedule.name}` '
             f'at execution time `{pipeline_run.execution_date}`. Error: None'
         )
+        title = 'Failed to run Mage pipeline test_pipeline'
         mock_send_teams_message.assert_called_once_with(
             notification_config.teams_config,
             message,
+            title
         )
 
     @patch('mage_ai.orchestration.notification.sender.send_teams_message')
@@ -131,9 +133,11 @@ class NotificationSenderTests(DBTestCase):
             f'`{pipeline_run.pipeline_schedule.name}` '
             f'at execution time `{pipeline_run.execution_date}`.'
         )
+        title = 'Successfully ran Pipeline test_pipeline'
         mock_send_teams_message.assert_called_once_with(
             notification_config.teams_config,
             message,
+            title
         )
 
     @patch('mage_ai.orchestration.notification.sender.send_teams_message')
@@ -162,4 +166,4 @@ class NotificationSenderTests(DBTestCase):
             notification_config.opsgenie_config,
             message=ANY,
             description=ANY,
-        )
+        )
\ No newline at end of file