use query for get api
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
@@ -8,6 +9,7 @@ from flask_cors import CORS, cross_origin
|
|||||||
from flask_httpauth import HTTPTokenAuth
|
from flask_httpauth import HTTPTokenAuth
|
||||||
|
|
||||||
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
||||||
|
from src.mail.mail_sender import MailSender
|
||||||
from src.workers.SpeechToText import SpeechToText
|
from src.workers.SpeechToText import SpeechToText
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@@ -28,7 +30,17 @@ def verify_token(token):
|
|||||||
@cross_origin()
|
@cross_origin()
|
||||||
def send_email():
|
def send_email():
|
||||||
data_in_json = request.get_json()
|
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
|
return '', 204
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
from src.pojo.contact_pojo import ContactPojo
|
|
||||||
|
|
||||||
|
|
||||||
class EmailReceiver:
|
class EmailReceiver:
|
||||||
def __init__(self, mail_address: str, store_type: int, id: str, date: str):
|
def __init__(self, mail_address: str, store_type: int, id: str, date: str):
|
||||||
self.mail_address = mail_address
|
self.mail_address = mail_address
|
||||||
|
|||||||
Reference in New Issue
Block a user