We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Mail: New Session Proposals not Sent out to Organizers and Co-organizers
After the submission of several people the new Session Proposals have not been sent out to Organizers and Co-organizers. One reason could be, that these people did not verify their email address.

Please check configuration and ensure all emails of all submissions are sent to organizers/co-organizers.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `app/helpers/notification_email_triggers.py`
Content:
```
1 from flask import url_for
2 
3 from app.helpers.data_getter import DataGetter
4 from app.helpers.helpers import send_new_session_organizer, send_notif_new_session_organizer, \
5     send_notif_session_accept_reject, send_session_accept_reject, send_schedule_change, send_notif_session_schedule, \
6     send_email_for_after_purchase_organizers, send_notif_for_after_purchase_organizer
7 from app.models.mail import NEW_SESSION, SESSION_ACCEPT_REJECT, SESSION_SCHEDULE, TICKET_PURCHASED
8 
9 
10 def trigger_new_session_notifications(session_id, event_id=None, event=None):
11     if not event and not event_id:
12         raise Exception('event or event_id is required')
13     if not event:
14         event = DataGetter.get_event(event_id)
15 
16     link = url_for('event_sessions.session_display_view',
17                    event_id=event.id, session_id=session_id, _external=True)
18 
19     admin_msg_setting = DataGetter.get_message_setting_by_action(NEW_SESSION)
20     organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')
21     for organizer in organizers:
22         email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event_id)
23         if not admin_msg_setting or \
24             (email_notification_setting and email_notification_setting.new_paper == 1 and
25              admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:
26 
27             send_new_session_organizer(organizer.user.email, event.name, link)
28         # Send notification
29         send_notif_new_session_organizer(organizer.user, event.name, link)
30 
31 
32 def trigger_session_state_change_notifications(session, event_id, state=None, message=None, subject=None):
33     if not state:
34         state = session.state
35     link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)
36     admin_msg_setting = DataGetter.get_message_setting_by_action(SESSION_ACCEPT_REJECT)
37     for speaker in session.speakers:
38         email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)
39         if not admin_msg_setting or \
40             (email_notification_setting and email_notification_setting.session_accept_reject == 1 and
41              admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:
42 
43             if speaker.email:
44                 send_session_accept_reject(speaker.email, session.title, state, link, subject=subject, message=message)
45             # Send notification
46         if speaker.user:
47             send_notif_session_accept_reject(speaker.user, session.title, state, link)
48     session.state_email_sent = True
49     from app.helpers.data import save_to_db
50     save_to_db(session)
51 
52 
53 def trigger_session_schedule_change_notifications(session, event_id):
54     link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)
55     admin_msg_setting = DataGetter.get_message_setting_by_action(SESSION_SCHEDULE)
56     for speaker in session.speakers:
57         email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)
58         if not admin_msg_setting or \
59             (email_notification_setting and email_notification_setting.session_schedule == 1 and
60              admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:
61             if speaker.email:
62                 send_schedule_change(speaker.email, session.title, link)
63         # Send notification
64         if speaker.user:
65             send_notif_session_schedule(speaker.user, session.title, link)
66 
67 
68 def trigger_after_purchase_notifications(buyer_email, event_id, event, invoice_id, order_url):
69     if not event and not event_id:
70         raise Exception('event or event_id is required')
71     if not event:
72         event = DataGetter.get_event(event_id)
73 
74     admin_msg_setting = DataGetter.get_message_setting_by_action(TICKET_PURCHASED)
75     organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')
76     for organizer in organizers:
77         email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event_id)
78         if not admin_msg_setting or \
79             (email_notification_setting and email_notification_setting.after_ticket_purchase == 1 and
80              admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:
81             send_email_for_after_purchase_organizers(organizer.user.email, buyer_email, invoice_id, order_url, event.name, event.organizer_name)
82         send_notif_for_after_purchase_organizer(organizer.user, invoice_id, order_url, event.name, buyer_email)
83 
84     coorganizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'coorganizer')
85     for coorganizer in coorganizers:
86         email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(coorganizer.user.id, event_id)
87         if not admin_msg_setting or \
88             (email_notification_setting and email_notification_setting.after_ticket_purchase == 1 and
89                      admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:
90             send_email_for_after_purchase_organizers(coorganizer.user.email, buyer_email, invoice_id, order_url, event.name, event.organizer_name)
91         send_notif_for_after_purchase_organizer(organizer.user, invoice_id, order_url, event.name, buyer_email)
92
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/app/helpers/notification_email_triggers.py b/app/helpers/notification_email_triggers.py
--- a/app/helpers/notification_email_triggers.py
+++ b/app/helpers/notification_email_triggers.py
@@ -19,7 +19,7 @@
     admin_msg_setting = DataGetter.get_message_setting_by_action(NEW_SESSION)
     organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')
     for organizer in organizers:
-        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event_id)
+        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event.id)
         if not admin_msg_setting or \
             (email_notification_setting and email_notification_setting.new_paper == 1 and
              admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:

{"golden_diff": "diff --git a/app/helpers/notification_email_triggers.py b/app/helpers/notification_email_triggers.py\n--- a/app/helpers/notification_email_triggers.py\n+++ b/app/helpers/notification_email_triggers.py\n@@ -19,7 +19,7 @@\n     admin_msg_setting = DataGetter.get_message_setting_by_action(NEW_SESSION)\n     organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')\n     for organizer in organizers:\n-        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event_id)\n+        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event.id)\n         if not admin_msg_setting or \\\n             (email_notification_setting and email_notification_setting.new_paper == 1 and\n              admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n", "issue": "Mail: New Session Proposals not Sent out to Organizers and Co-organizers\nAfter the submission of several people the new Session Proposals have not been sent out to Organizers and Co-organizers. One reason could be, that these people did not verify their email address.\r\n\r\nPlease check configuration and ensure all emails of all submissions are sent to organizers/co-organizers.\n", "before_files": [{"content": "from flask import url_for\n\nfrom app.helpers.data_getter import DataGetter\nfrom app.helpers.helpers import send_new_session_organizer, send_notif_new_session_organizer, \\\n    send_notif_session_accept_reject, send_session_accept_reject, send_schedule_change, send_notif_session_schedule, \\\n    send_email_for_after_purchase_organizers, send_notif_for_after_purchase_organizer\nfrom app.models.mail import NEW_SESSION, SESSION_ACCEPT_REJECT, SESSION_SCHEDULE, TICKET_PURCHASED\n\n\ndef trigger_new_session_notifications(session_id, event_id=None, event=None):\n    if not event and not event_id:\n        raise Exception('event or event_id is required')\n    if not event:\n        event = DataGetter.get_event(event_id)\n\n    link = url_for('event_sessions.session_display_view',\n                   event_id=event.id, session_id=session_id, _external=True)\n\n    admin_msg_setting = DataGetter.get_message_setting_by_action(NEW_SESSION)\n    organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')\n    for organizer in organizers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.new_paper == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n\n            send_new_session_organizer(organizer.user.email, event.name, link)\n        # Send notification\n        send_notif_new_session_organizer(organizer.user, event.name, link)\n\n\ndef trigger_session_state_change_notifications(session, event_id, state=None, message=None, subject=None):\n    if not state:\n        state = session.state\n    link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)\n    admin_msg_setting = DataGetter.get_message_setting_by_action(SESSION_ACCEPT_REJECT)\n    for speaker in session.speakers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.session_accept_reject == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n\n            if speaker.email:\n                send_session_accept_reject(speaker.email, session.title, state, link, subject=subject, message=message)\n            # Send notification\n        if speaker.user:\n            send_notif_session_accept_reject(speaker.user, session.title, state, link)\n    session.state_email_sent = True\n    from app.helpers.data import save_to_db\n    save_to_db(session)\n\n\ndef trigger_session_schedule_change_notifications(session, event_id):\n    link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)\n    admin_msg_setting = DataGetter.get_message_setting_by_action(SESSION_SCHEDULE)\n    for speaker in session.speakers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.session_schedule == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n            if speaker.email:\n                send_schedule_change(speaker.email, session.title, link)\n        # Send notification\n        if speaker.user:\n            send_notif_session_schedule(speaker.user, session.title, link)\n\n\ndef trigger_after_purchase_notifications(buyer_email, event_id, event, invoice_id, order_url):\n    if not event and not event_id:\n        raise Exception('event or event_id is required')\n    if not event:\n        event = DataGetter.get_event(event_id)\n\n    admin_msg_setting = DataGetter.get_message_setting_by_action(TICKET_PURCHASED)\n    organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')\n    for organizer in organizers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.after_ticket_purchase == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n            send_email_for_after_purchase_organizers(organizer.user.email, buyer_email, invoice_id, order_url, event.name, event.organizer_name)\n        send_notif_for_after_purchase_organizer(organizer.user, invoice_id, order_url, event.name, buyer_email)\n\n    coorganizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'coorganizer')\n    for coorganizer in coorganizers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(coorganizer.user.id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.after_ticket_purchase == 1 and\n                     admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n            send_email_for_after_purchase_organizers(coorganizer.user.email, buyer_email, invoice_id, order_url, event.name, event.organizer_name)\n        send_notif_for_after_purchase_organizer(organizer.user, invoice_id, order_url, event.name, buyer_email)\n", "path": "app/helpers/notification_email_triggers.py"}], "after_files": [{"content": "from flask import url_for\n\nfrom app.helpers.data_getter import DataGetter\nfrom app.helpers.helpers import send_new_session_organizer, send_notif_new_session_organizer, \\\n    send_notif_session_accept_reject, send_session_accept_reject, send_schedule_change, send_notif_session_schedule, \\\n    send_email_for_after_purchase_organizers, send_notif_for_after_purchase_organizer\nfrom app.models.mail import NEW_SESSION, SESSION_ACCEPT_REJECT, SESSION_SCHEDULE, TICKET_PURCHASED\n\n\ndef trigger_new_session_notifications(session_id, event_id=None, event=None):\n    if not event and not event_id:\n        raise Exception('event or event_id is required')\n    if not event:\n        event = DataGetter.get_event(event_id)\n\n    link = url_for('event_sessions.session_display_view',\n                   event_id=event.id, session_id=session_id, _external=True)\n\n    admin_msg_setting = DataGetter.get_message_setting_by_action(NEW_SESSION)\n    organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')\n    for organizer in organizers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event.id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.new_paper == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n\n            send_new_session_organizer(organizer.user.email, event.name, link)\n        # Send notification\n        send_notif_new_session_organizer(organizer.user, event.name, link)\n\n\ndef trigger_session_state_change_notifications(session, event_id, state=None, message=None, subject=None):\n    if not state:\n        state = session.state\n    link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)\n    admin_msg_setting = DataGetter.get_message_setting_by_action(SESSION_ACCEPT_REJECT)\n    for speaker in session.speakers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.session_accept_reject == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n\n            if speaker.email:\n                send_session_accept_reject(speaker.email, session.title, state, link, subject=subject, message=message)\n            # Send notification\n        if speaker.user:\n            send_notif_session_accept_reject(speaker.user, session.title, state, link)\n    session.state_email_sent = True\n    from app.helpers.data import save_to_db\n    save_to_db(session)\n\n\ndef trigger_session_schedule_change_notifications(session, event_id):\n    link = url_for('event_sessions.session_display_view', event_id=event_id, session_id=session.id, _external=True)\n    admin_msg_setting = DataGetter.get_message_setting_by_action(SESSION_SCHEDULE)\n    for speaker in session.speakers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(speaker.user_id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.session_schedule == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n            if speaker.email:\n                send_schedule_change(speaker.email, session.title, link)\n        # Send notification\n        if speaker.user:\n            send_notif_session_schedule(speaker.user, session.title, link)\n\n\ndef trigger_after_purchase_notifications(buyer_email, event_id, event, invoice_id, order_url):\n    if not event and not event_id:\n        raise Exception('event or event_id is required')\n    if not event:\n        event = DataGetter.get_event(event_id)\n\n    admin_msg_setting = DataGetter.get_message_setting_by_action(TICKET_PURCHASED)\n    organizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'organizer')\n    for organizer in organizers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(organizer.user.id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.after_ticket_purchase == 1 and\n             admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n            send_email_for_after_purchase_organizers(organizer.user.email, buyer_email, invoice_id, order_url, event.name, event.organizer_name)\n        send_notif_for_after_purchase_organizer(organizer.user, invoice_id, order_url, event.name, buyer_email)\n\n    coorganizers = DataGetter.get_user_event_roles_by_role_name(event.id, 'coorganizer')\n    for coorganizer in coorganizers:\n        email_notification_setting = DataGetter.get_email_notification_settings_by_event_id(coorganizer.user.id, event_id)\n        if not admin_msg_setting or \\\n            (email_notification_setting and email_notification_setting.after_ticket_purchase == 1 and\n                     admin_msg_setting.user_control_status == 1) or admin_msg_setting.user_control_status == 0:\n            send_email_for_after_purchase_organizers(coorganizer.user.email, buyer_email, invoice_id, order_url, event.name, event.organizer_name)\n        send_notif_for_after_purchase_organizer(organizer.user, invoice_id, order_url, event.name, buyer_email)\n", "path": "app/helpers/notification_email_triggers.py"}]}