[email] Get email row directly
This commit is contained in:
parent
0dbade63ac
commit
1ea8f3b3e2
|
@ -8,7 +8,7 @@ import re
|
||||||
import requests
|
import requests
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from kibicara.model import Hood
|
from kibicara.model import Hood
|
||||||
from kibicara.platforms.email.webapi import get_email
|
from kibicara.platforms.email.model import Email
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ async def main():
|
||||||
# extract hood name from the envelope recipient address
|
# extract hood name from the envelope recipient address
|
||||||
hood_name = args.recipient_address.split('@')[0]
|
hood_name = args.recipient_address.split('@')[0]
|
||||||
hood = await Hood.objects.get(name=hood_name)
|
hood = await Hood.objects.get(name=hood_name)
|
||||||
email_row = await get_email(hood=hood.id)
|
email_row = await Email.objects.get(hood=hood)
|
||||||
body = {
|
body = {
|
||||||
'text': text,
|
'text': text,
|
||||||
'author': mail.get_unixfrom(),
|
'author': mail.get_unixfrom(),
|
||||||
|
|
Loading…
Reference in a new issue