Преглед изворни кода

Enviar correo a destinatarios en html, avisa y vuelve al detalle

Celestino Rey пре 7 месеци
родитељ
комит
5b5c954fe8
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      src/eventos/views.py

+ 4 - 0
src/eventos/views.py

@@ -617,6 +617,10 @@ def enviar_correo_inscritos_html(request, evento_id):
                 )
                 msg.attach_alternative(html_content, "text/html")
                 msg.send()
+
+            messages.success(request, f"Correo enviado a {len(destinatarios)} inscritos.")
+            return redirect('eventos:detalle_evento', evento_id=evento.id)
+            
     else:
         form = MensajeCorreoForm()