Просмотр исходного кода

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

Celestino Rey 7 месяцев назад
Родитель
Сommit
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()