jupiter0913 commited on
Commit ·
47c3bc2
1
Parent(s): 8047f23
feature(#98): updated requirements text and gmail manager
Browse files
Brain/src/rising_plugin/gmail/{manage_gmail.py → email_plugin.py}
RENAMED
|
@@ -12,7 +12,7 @@ from email.message import EmailMessage
|
|
| 12 |
from bs4 import BeautifulSoup
|
| 13 |
|
| 14 |
|
| 15 |
-
class
|
| 16 |
def send_email(
|
| 17 |
self, sender: str, pwd: str, to: str, subject: str, body: str, to_send: bool
|
| 18 |
) -> str:
|
|
|
|
| 12 |
from bs4 import BeautifulSoup
|
| 13 |
|
| 14 |
|
| 15 |
+
class EmailPlugin:
|
| 16 |
def send_email(
|
| 17 |
self, sender: str, pwd: str, to: str, subject: str, body: str, to_send: bool
|
| 18 |
) -> str:
|
Brain/src/router/email_router.py
CHANGED
|
@@ -7,7 +7,7 @@ from Brain.src.common.brain_exception import BrainException
|
|
| 7 |
from Brain.src.model.requests.request_model import (
|
| 8 |
EmailReader,
|
| 9 |
)
|
| 10 |
-
from Brain.src.rising_plugin.gmail.
|
| 11 |
from Brain.src.firebase.firebase import firebase_admin_with_setting
|
| 12 |
|
| 13 |
router = APIRouter()
|
|
@@ -60,7 +60,7 @@ def construct_blueprint_email_api() -> APIRouter:
|
|
| 60 |
imap_search_cmd = "(ALL)"
|
| 61 |
|
| 62 |
# read emails
|
| 63 |
-
email_manager =
|
| 64 |
result = email_manager.read_emails(
|
| 65 |
sender=data.data.sender,
|
| 66 |
pwd=data.data.pwd,
|
|
|
|
| 7 |
from Brain.src.model.requests.request_model import (
|
| 8 |
EmailReader,
|
| 9 |
)
|
| 10 |
+
from Brain.src.rising_plugin.gmail.email_plugin import EmailPlugin
|
| 11 |
from Brain.src.firebase.firebase import firebase_admin_with_setting
|
| 12 |
|
| 13 |
router = APIRouter()
|
|
|
|
| 60 |
imap_search_cmd = "(ALL)"
|
| 61 |
|
| 62 |
# read emails
|
| 63 |
+
email_manager = EmailPlugin()
|
| 64 |
result = email_manager.read_emails(
|
| 65 |
sender=data.data.sender,
|
| 66 |
pwd=data.data.pwd,
|