aboutsummaryrefslogtreecommitdiffstats
path: root/aggro.py
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2023-09-27 18:30:05 +0300
committerJan Tuomi <jans.tuomi@gmail.com>2023-09-27 18:31:57 +0300
commit5e21128689f909309064025ace4526a330f0e58d (patch)
treeba49f30021ce3e8b1b387fe0aa2141f3dace609d /aggro.py
parentda9b89d089482354bce0fc95b66f30fd078405b1 (diff)
Specialize EmailAlerter to use SendGrid API
Diffstat (limited to 'aggro.py')
-rw-r--r--aggro.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/aggro.py b/aggro.py
index 4f315e4..0ba40f8 100644
--- a/aggro.py
+++ b/aggro.py
@@ -7,7 +7,7 @@ import time
from typing import Any
from tinydb import Query
-from app.AggroConfig import AggroConfig, AggroConfigServer, AggroConfigEmailAlerter
+from app.AggroConfig import AggroConfig, AggroConfigServer, AggroConfigSendGridAlerter
from app.MemoryState import memory_state
from app.PluginManager import PluginManager
from app.DatabaseManager import database_manager
@@ -44,11 +44,10 @@ if __name__ == "__main__":
port=get_config_or_default(aggrofile_server, "port", 8080),
)
- aggrofile_email_alerter = get_config_or_default(aggrofile, "email_alerter", None)
+ aggrofile_email_alerter = get_config_or_default(aggrofile, "sendgrid_alerter", None)
if aggrofile_email_alerter:
- email_alerter_config = AggroConfigEmailAlerter(
- api_url=get_config(aggrofile_email_alerter, "api_url"),
- api_headers=get_config(aggrofile_email_alerter, "api_headers"),
+ email_alerter_config = AggroConfigSendGridAlerter(
+ api_token=get_config(aggrofile_email_alerter, "api_token"),
email_from=get_config(aggrofile_email_alerter, "email_from"),
email_to=get_config(aggrofile_email_alerter, "email_to"),
)
@@ -57,7 +56,7 @@ if __name__ == "__main__":
aggro_config = AggroConfig(
server=server_config,
- email_alerter=email_alerter_config,
+ sendgrid_alerter=email_alerter_config,
db_path=get_config_or_default(aggrofile, "db_path", "db.json"),
plugins=get_config(aggrofile, "plugins"),
graph=get_config(aggrofile, "graph"),