예제 #1
0
 def send_reset_password_email(self, user, raw_password):
     mail_from = settings.REGISTER_EMAIL
     subject = u"Recuperación de su contraseña en Helpo"
     from common.templates import render_reset_password_email
     content = render_reset_password_email(user, raw_password)
     from common.notifications import send_mail_to
     send_mail_to(user.email, subject, content, mail_from)
예제 #2
0
def _send_participacion_email(participacion, titulo_email):
    subject_utf = u"Registro de su participación en Helpo"
    content = render_participacion_email(participacion, titulo_email)
    colaborador_mail = participacion.colaborador.email
    send_mail_to(colaborador_mail,
                 html_subject=subject_utf,
                 html_content=content)
예제 #3
0
 def send_change_password_email(self, user):
     mail_from = settings.REGISTER_EMAIL
     subject = u"Cambio de su contraseña en Helpo"
     from common.templates import render_change_password_email
     content = render_change_password_email(user)
     from common.notifications import send_mail_to
     send_mail_to(user.email, subject, content, mail_from)
예제 #4
0
파일: models.py 프로젝트: Jumpi96/helpo
 def send_warning_email(self, user):
     mail_from = settings.REGISTER_EMAIL
     entidad = user.USER_TYPE_CHOICES[int(user.user_type)][1]
     subject = u'ALERTA: Un usuario de tipo %s y nombre "%s" se ha registrado en Helpo' % (
         entidad, user.nombre)
     from common.templates import render_warning_email
     content = render_warning_email(user, entidad)
     from common.notifications import send_mail_to
     send_mail_to("*****@*****.**", subject, content, mail_from)
예제 #5
0
 def send_warning_email(self, user):
     mail_from = settings.REGISTER_EMAIL
     entidad = "organización" if user.user_type == 1 else "empresa"
     subject = u'ALERTA: La %s "%s" se ha registrado en Helpo' % (
         entidad, user.nombre)
     from common.templates import render_warning_email
     content = render_warning_email(user, entidad)
     from common.notifications import send_mail_to
     send_mail_to("*****@*****.**", subject, content, mail_from)
예제 #6
0
파일: services.py 프로젝트: Jumpi96/helpo
def send_ong_colaboracion_mail(necesidad_material,
                               colaboracion,
                               cancelada=False):
    organizacion_email = necesidad_material.evento.organizacion.email
    profile = VolunteerProfile.objects.filter(
        usuario=colaboracion.colaborador)[0]
    title = "Colaboración cancelada en su evento en Helpo" if cancelada else "Nueva colaboración en su evento en Helpo"
    send_mail_to(
        organizacion_email, title,
        render_ong_colaboracion_email(necesidad_material, colaboracion,
                                      profile, cancelada))
예제 #7
0
파일: services.py 프로젝트: Jumpi96/helpo
def send_ong_participacion_mail(necesidad_voluntario,
                                participacion,
                                cancelada=False):
    organizacion_email = necesidad_voluntario.evento.organizacion.email
    profile = VolunteerProfile.objects.filter(
        usuario=participacion.colaborador)[0]
    title = "Participación cancelada en su evento en Helpo" if cancelada else "Nueva participación en su evento en Helpo"
    send_mail_to(
        organizacion_email, title,
        render_ong_participacion_email(necesidad_voluntario, profile,
                                       participacion, cancelada))
예제 #8
0
 def send_verification_email(self, user):
     user_verification = UserVerification.objects.get(usuario=user)
     if user_verification is not None:
         bash = user_verification.verificationToken
         mail_from = settings.REGISTER_EMAIL
         subject = "Verifique su registro en Helpo"
         url_confirmation = '%s/#/confirmMail/%s' % (config('URL_CLIENT', default='localhost:3000'), bash)
         from common.templates import render_verify_email
         content = render_verify_email(url_confirmation)
         from common.notifications import send_mail_to
         send_mail_to(user.email, subject, content, mail_from)
예제 #9
0
def send_previous_mail_evento(evento_id, colaborador_id):
    mensajes = Mensaje.objects.filter(evento_id=evento_id)
    evento = Evento.objects.filter(id=evento_id).first()
    colaborador_email = User.objects.filter(id=colaborador_id).first().email
    for mensaje in mensajes:
        if len(
                LogMensaje.objects.filter(mensaje_id=mensaje.id,
                                          usuario_id=colaborador_id)) == 0:
            send_mail_to(
                colaborador_email,
                "Helpo: " + mensaje.asunto + " (" + evento.nombre + ")",
                render_mensaje_evento(evento, mensaje.mensaje))
            LogMensaje.objects.create(usuario_id=colaborador_id,
                                      mensaje_id=mensaje.id)
예제 #10
0
파일: models.py 프로젝트: Jumpi96/helpo
    def send_confirmation_email(self, user):
        bash = ''.join(random.SystemRandom().choice(string.ascii_uppercase +
                                                    string.digits)
                       for _ in range(16))
        self.create_user_verification(user, bash)

        mail_from = settings.REGISTER_EMAIL
        subject = "Verifique su registro en Helpo"
        url_confirmation = '%s/#/confirmMail/%s' % (config(
            'URL_CLIENT', default='localhost:3001'), bash)
        from common.templates import render_verify_email
        content = render_verify_email(url_confirmation)

        from common.notifications import send_mail_to
        send_mail_to(user.email, subject, content, mail_from)
예제 #11
0
def send_was_full_colaboracion_mail(necesidad_material):
    organizacion_email = necesidad_material.evento.organizacion.email
    send_mail_to(organizacion_email, "Necesidad pendiente en Helpo",
                 render_was_full_colaboracion_email(necesidad_material))
예제 #12
0
def send_full_colaboracion_mail(necesidad_material):
    organizacion_email = necesidad_material.evento.organizacion.email
    send_mail_to(organizacion_email, "Necesidad cubierta en Helpo",
                 render_full_colaboracion_email(necesidad_material))
예제 #13
0
def send_was_full_participacion_mail(necesidad_voluntario):
    organizacion_email = necesidad_voluntario.evento.organizacion.email
    send_mail_to(organizacion_email, "Necesidad pendiente en Helpo",
                 render_was_full_participacion_email(necesidad_voluntario))
예제 #14
0
def send_full_participacion_mail(necesidad_voluntario):
    organizacion_email = necesidad_voluntario.evento.organizacion.email
    send_mail_to(organizacion_email, "Necesidad cubierta en Helpo",
                 render_full_participacion_email(necesidad_voluntario))