Tu Nombre commited on
Commit
3eb54fb
·
1 Parent(s): 86cfe52

migrar a brevo

Browse files
Files changed (1) hide show
  1. main.py +8 -3
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.resend.com/emails",
54
- headers={"Authorization": f"Bearer " + RESEND_KEY, "Content-Type": "application/json"},
55
- json={"from":"TubeBot <onboarding@resend.dev>","to":email,"subject":"Tu canal de YouTube esta listo","html":html}
 
 
 
 
 
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}")