AIdeaText commited on
Commit
796d785
verified
2 Parent(s): 7284cbd 3c9e41a

Merge branch #AIdeaText/test' into 'AIdeaText/test2'

Browse files
Files changed (1) hide show
  1. modules/email/email.py +10 -4
modules/email/email.py CHANGED
@@ -6,7 +6,7 @@ import os
6
  def send_email_notification(name, email, institution, role, reason):
7
  sender_email = "[email protected]" # Configura esto con tu direcci贸n de correo
8
  receiver_email = "[email protected]"
9
- password = os.environ.get("EMAIL_PASSWORD") # Configura esto en tus variables de entorno
10
 
11
  message = MIMEMultipart("alternative")
12
  message["Subject"] = "Nueva solicitud de prueba de AIdeaText"
@@ -42,9 +42,12 @@ def send_email_notification(name, email, institution, role, reason):
42
  message.attach(part2)
43
 
44
  try:
45
- with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
 
46
  server.login(sender_email, password)
 
47
  server.sendmail(sender_email, receiver_email, message.as_string())
 
48
  logger.info(f"Email notification sent for application request: {email}")
49
  return True
50
  except Exception as e:
@@ -54,7 +57,7 @@ def send_email_notification(name, email, institution, role, reason):
54
  def send_user_feedback_notification(name, email, feedback):
55
  sender_email = "[email protected]"
56
  receiver_email = "[email protected]" # Cambia esto a la direcci贸n que desees
57
- password = os.environ.get("EMAIL_PASSWORD")
58
 
59
  message = MIMEMultipart("alternative")
60
  message["Subject"] = "Nuevo comentario de usuario en AIdeaText"
@@ -76,9 +79,12 @@ def send_user_feedback_notification(name, email, feedback):
76
  message.attach(part)
77
 
78
  try:
79
- with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
 
80
  server.login(sender_email, password)
 
81
  server.sendmail(sender_email, receiver_email, message.as_string())
 
82
  logger.info(f"Email notification sent for user feedback from: {email}")
83
  return True
84
  except Exception as e:
 
6
  def send_email_notification(name, email, institution, role, reason):
7
  sender_email = "[email protected]" # Configura esto con tu direcci贸n de correo
8
  receiver_email = "[email protected]"
9
+ password = os.environ.get("NOREPLY_EMAIL_PASSWORD") # Configura esto en tus variables de entorno
10
 
11
  message = MIMEMultipart("alternative")
12
  message["Subject"] = "Nueva solicitud de prueba de AIdeaText"
 
42
  message.attach(part2)
43
 
44
  try:
45
+ with smtplib.SMTP_SSL("smtp.titan.email", 465) as server:
46
+ logger.info("Conectado al servidor SMTP")
47
  server.login(sender_email, password)
48
+ logger.info("Inicio de sesi贸n exitoso")
49
  server.sendmail(sender_email, receiver_email, message.as_string())
50
+ logger.info(f"Correo enviado de {sender_email} a {receiver_email}")
51
  logger.info(f"Email notification sent for application request: {email}")
52
  return True
53
  except Exception as e:
 
57
  def send_user_feedback_notification(name, email, feedback):
58
  sender_email = "[email protected]"
59
  receiver_email = "[email protected]" # Cambia esto a la direcci贸n que desees
60
+ password = os.environ.get("NOREPLY_EMAIL_PASSWORD")
61
 
62
  message = MIMEMultipart("alternative")
63
  message["Subject"] = "Nuevo comentario de usuario en AIdeaText"
 
79
  message.attach(part)
80
 
81
  try:
82
+ with smtplib.SMTP_SSL("smtp.titan.email", 465) as server:
83
+ logger.info("Conectado al servidor SMTP")
84
  server.login(sender_email, password)
85
+ logger.info("Inicio de sesi贸n exitoso")
86
  server.sendmail(sender_email, receiver_email, message.as_string())
87
+ logger.info(f"Correo enviado de {sender_email} a {receiver_email}")
88
  logger.info(f"Email notification sent for user feedback from: {email}")
89
  return True
90
  except Exception as e: