From 6dd7cb6f8289472869c835cf3b9982fea1512745 Mon Sep 17 00:00:00 2001 From: "jp.av.dev" Date: Sun, 15 Nov 2020 03:46:07 -0300 Subject: [PATCH] mail desde fromulario de contacto --- TiendaOnline/gestionPedidos/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TiendaOnline/gestionPedidos/views.py b/TiendaOnline/gestionPedidos/views.py index 02f6c09..17a67de 100644 --- a/TiendaOnline/gestionPedidos/views.py +++ b/TiendaOnline/gestionPedidos/views.py @@ -1,6 +1,8 @@ from django.shortcuts import render from django.http import HttpResponse from gestionPedidos.models import Articulos +from django.core.mail import send_mail +from django.conf import settings # Create your views here. def busqueda_productos(request): @@ -22,6 +24,11 @@ def buscar(request): def contacto(request): if request.method == "POST": + subject = request.POST['asunto'] + message = request.POST['mensaje']+' '+request.POST['mail'] + email_from = settings.EMAIL_HOST_USER + recipient_list = ['ratablastard@gmail.com'] + send_mail(subject, message, email_from, recipient_list) return render(request, "gracias.html") return render(request, "contacto.html")