Spaces:
Runtime error
Runtime error
Commit
·
9ee00e3
1
Parent(s):
fde59e3
update congifenv
Browse files- TechdocsAPI/backend/services/auth/ops.py +16 -10
- temp.py +3 -3
TechdocsAPI/backend/services/auth/ops.py
CHANGED
@@ -39,18 +39,24 @@ async def ops_signup(bgtasks: BackgroundTasks, response_result: GeneralResponse,
|
|
39 |
"verify_link": verification_link
|
40 |
}
|
41 |
|
42 |
-
message = MessageSchema(
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
|
55 |
|
56 |
|
|
|
39 |
"verify_link": verification_link
|
40 |
}
|
41 |
|
42 |
+
# message = MessageSchema(
|
43 |
+
# subject="Welcome to Techdocs:[Account Verification]",
|
44 |
+
# recipients=[data.email], # List of recipients, as many as you can pass
|
45 |
+
# template_body=email_body_params,
|
46 |
+
# subtype=MessageType.html
|
47 |
+
# )
|
48 |
+
details = {
|
49 |
+
"recipients": [data.email],
|
50 |
+
"subject": "Welcome to Techdocs:[Account Verification]",
|
51 |
+
"template_name": "email_verification.html",
|
52 |
+
"template_kwargs": email_body_params
|
53 |
+
}
|
54 |
|
55 |
+
# await app.state.mail_client.send_message(message=message, template_name="email_verification.html")
|
56 |
|
57 |
+
status = post_request(url=config.MAIL_SERVER_URL, data=details, headers=None)
|
58 |
+
if status != 200:
|
59 |
+
raise EmailNotSentException()
|
60 |
|
61 |
|
62 |
|
temp.py
CHANGED
@@ -10,12 +10,12 @@ def post_request(url, data, headers=None):
|
|
10 |
|
11 |
email_body_params = {
|
12 |
"username": "mayo",
|
13 |
-
"verify_link": "
|
14 |
}
|
15 |
details = {
|
16 |
-
"
|
17 |
"subject": "Welcome to Techdocs:[Account Verification]",
|
18 |
"template_name": "email_verification.html",
|
19 |
"template_kwargs": email_body_params
|
20 |
}
|
21 |
-
print(post_request("https://
|
|
|
10 |
|
11 |
email_body_params = {
|
12 |
"username": "mayo",
|
13 |
+
"verify_link": "new hai yeh bro agar ye aya toh maja aya"
|
14 |
}
|
15 |
details = {
|
16 |
+
"recipients": ["[email protected]", "[email protected]"],
|
17 |
"subject": "Welcome to Techdocs:[Account Verification]",
|
18 |
"template_name": "email_verification.html",
|
19 |
"template_kwargs": email_body_params
|
20 |
}
|
21 |
+
print(post_request("https://api.techdocs.caffienecrewhacks.tech/api/send", details))
|