From 78b271c418d843c94fc1971b338855076eb69a34 Mon Sep 17 00:00:00 2001 From: maike Date: Mon, 6 Jul 2020 16:31:30 +0200 Subject: [PATCH] [email] Send messages to email recipients --- kibicara/platforms/email/bot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kibicara/platforms/email/bot.py b/kibicara/platforms/email/bot.py index 67aa6e0..052031c 100644 --- a/kibicara/platforms/email/bot.py +++ b/kibicara/platforms/email/bot.py @@ -5,6 +5,7 @@ from kibicara.platforms.email.model import EmailRecipients, Email from kibicara.platformapi import Censor, Spawner, Message from logging import getLogger +from kibicara.email import send_email logger = getLogger(__name__) @@ -18,8 +19,8 @@ class EmailBot(Censor): async def run(self): while True: message = await self.receive() - print("push " + message.text) - # send message to everyone in EmailRecipients(hood=self.hood) + for recipient in EmailRecipients(hood=self.hood): + send_email(recipient.email, "Kibicara " + self.hood, body=message.text) spawner = Spawner(Email, EmailBot)