Browse Source

Prueba funcionalidad envío correo

politica
Celestino Rey 1 year ago
parent
commit
4c065a1c5f
3 changed files with 28 additions and 2 deletions
  1. +26
    -0
      Padel/padel/paginas.py
  2. +1
    -1
      Padel/padel/templates/reservas/misreservas.html
  3. +1
    -1
      Padel/padel/templates/reservas/reservar.html

+ 26
- 0
Padel/padel/paginas.py View File

@ -1,10 +1,25 @@
from flask import (
Flask,
Blueprint,
render_template
)
from flask_mail import Mail, Message
bp = Blueprint("paginas", __name__)
app = Flask(__name__)
app.config['MAIL_SERVER']= 'smtp.mail.yahoo.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USERNAME'] = 'celestino_rey@ymail.com'
app.config['MAIL_PASSWORD'] = 'kbryvwxkockqckss'
app.config['MAIL_USE_TLS'] = False
app.config['MAIL_USE_SSL'] = True
mail = Mail(app)
#mail.init_app(app)
@bp.route("/")
def inicio():
return render_template("autorizacion/index.html")
@ -12,3 +27,14 @@ def inicio():
@bp.route("/acerca")
def acerca():
return render_template("paginas/acerca.html")
@bp.route("/envia_mail")
def envia_mail():
msg = Message('Hola desde el otro lado!', sender='celestino_rey@ymail.com', recipients=['king.bernard.b@gmail.com'])
msg.body = "Hola, companero, te envio este correo para ver si funciona."
mail.send(msg)
return "Mensaje enviado"

+ 1
- 1
Padel/padel/templates/reservas/misreservas.html View File

@ -5,7 +5,7 @@
<h1 class="title is-1">
¡Bienvenido, {{ name }}!
</h1>
<h1 class="subtitle is-1 has-text-centered">
<h1 class="subtitle is-2 has-text-centered">
Estas son tus reservas de padel
</h1>
</section>


+ 1
- 1
Padel/padel/templates/reservas/reservar.html View File

@ -8,7 +8,7 @@
{% block content %}
<section class="hero is-primary has-text-centered">
<h1 class="subtitle is-1 has-text-centered">
<h1 class="subtitle is-2 has-text-centered">
Estas son las horas disponibles y las ocupadas
</h1>
</section>


Loading…
Cancel
Save