Spaces:
Running
Running
Tu Nombre commited on
Commit ·
3eb54fb
1
Parent(s): 86cfe52
migrar a brevo
Browse files
main.py
CHANGED
|
@@ -50,9 +50,14 @@ def enviar_email(email, nicho, url):
|
|
| 50 |
</p>
|
| 51 |
<p style="color:#666;font-size:.85rem;">Si tienes dudas responde este email.</p>
|
| 52 |
</div>"""
|
| 53 |
-
requests.post("https://api.
|
| 54 |
-
headers={"
|
| 55 |
-
json={
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
)
|
| 57 |
except Exception as e:
|
| 58 |
print(f"Error email: {e}")
|
|
|
|
| 50 |
</p>
|
| 51 |
<p style="color:#666;font-size:.85rem;">Si tienes dudas responde este email.</p>
|
| 52 |
</div>"""
|
| 53 |
+
requests.post("https://api.brevo.com/v3/smtp/email",
|
| 54 |
+
headers={"api-key": os.environ.get("BREVO_KEY",""), "Content-Type": "application/json", "accept": "application/json"},
|
| 55 |
+
json={
|
| 56 |
+
"sender": {"name": "TubeBot", "email": "dayron100813@gmail.com"},
|
| 57 |
+
"to": [{"email": email}],
|
| 58 |
+
"subject": "Tu canal de YouTube ya esta listo",
|
| 59 |
+
"htmlContent": html
|
| 60 |
+
}
|
| 61 |
)
|
| 62 |
except Exception as e:
|
| 63 |
print(f"Error email: {e}")
|