use query for get api

This commit is contained in:
2023-01-16 00:30:03 +01:00
parent 18cfd6b2c4
commit 387bf9d423
2 changed files with 13 additions and 4 deletions
+13 -1
View File
@@ -1,3 +1,4 @@
import json
import os
import uuid
@@ -8,6 +9,7 @@ from flask_cors import CORS, cross_origin
from flask_httpauth import HTTPTokenAuth
from src.db.mongo_manager import MONGO_STORE_MANAGER
from src.mail.mail_sender import MailSender
from src.workers.SpeechToText import SpeechToText
app = Flask(__name__)
@@ -28,7 +30,17 @@ def verify_token(token):
@cross_origin()
def send_email():
data_in_json = request.get_json()
print(data_in_json)
store = data_in_json['store']
url = data_in_json['url']
id = data_in_json['id']
message = data_in_json['message']
dest_email = data_in_json['dest_email']
contact_name = data_in_json['contact_name']
body = message.replace('/client/' + id, url)
sender = MailSender(dest_email=dest_email, email_body=body, store=store, contact_name=contact_name)
print("data_in_json is " + json.dumps(data_in_json))
print("body is " + body)
sender.send()
return '', 204
-3
View File
@@ -1,6 +1,3 @@
from src.pojo.contact_pojo import ContactPojo
class EmailReceiver:
def __init__(self, mail_address: str, store_type: int, id: str, date: str):
self.mail_address = mail_address