Example #1
0
def send_email(request):
    if request.method == 'POST':
        subject = request.POST.get('subject', '')
        message = request.POST.get('message', '')
        from_email = request.POST.get('email', '')
        contexto = {
            'name': request.POST.get('name', ''),
            'subject': subject,
            'from_email': from_email,
            'message': message
        }
        if subject and message and from_email:
            template_name = 'contatoEmail.html'
            send_mail_template(subject, template_name, contexto, from_email)
            context = {
                'title': 'SK imobiliaria',
                'email_msg': 'Enviado com sucesso'
            }
            return render(request, 'index.html', context)
        else:
            context = {
                'title': 'SK imobiliaria',
                'email_msg': 'Erro ao enviar email'
            }
            return render(request, 'index.html', context)
Example #2
0
 def send_mail(self):
     subject = 'Contato'
     context = {
         'email': self.cleaned_data['email'],
     }
     template_name = 'contact_email.html'
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
Example #3
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data["email"])
     key = generate_hash_key(user.username)
     reset = PasswordReset(user=user, key=key)
     reset.save()
     template_name = "accounts/password_reset_mail.html"
     subject = "Criar nova senha no Simple MOOC"
     context = {"reset": reset}
     send_mail_template(subject, template_name, context, [user.email])
Example #4
0
 def save(self):
     user = Person.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.name)
     reset = PasswordReset(user=user, key=key)
     reset.save()
     template_name = 'accounts/password_reset_email.html'
     subject = 'Recuperação de senha - Autoescola Esperança'
     context = {'reset': reset}
     send_mail_template(subject, template_name, context, [user.email])
Example #5
0
 def save(self):
     user = AcoountUser.objects.get(email=form.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     template_name = 'password_reset_mail.html'
     subject = 'Criar nova senha no Simple MOOC'
     context = {'reset': reset}
     send_mail_template(subject, template_name, context, [user.email])
Example #6
0
 def send_mail(self, course):
     subject = "[%s] Contato" % course
     context = {
         "name": self.cleaned_data["name"],
         "email": self.cleaned_data["email"],
         "message": self.cleaned_data["message"],
     }
     template_name = "courses/contact_email.html"
     send_mail_template(subject, template_name, context, [settings.CONTACT_EMAIL])
Example #7
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.email)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     template_name = 'account/password_reset_mail.html'
     subject = 'Criar nova senha de acesso para o Active Gears'
     context = {'reset': reset}
     send_mail_template(subject, template_name, context, [user.email])
Example #8
0
    def send_email(self, curso):
        subject = f'Contato do Curso de [{curso}]'
        context = {
            'nome': self.cleaned_data['nome'],
            'email': self.cleaned_data['email'],
            'message': self.cleaned_data['message']
        }

        send_mail_template(subject, 'cursos/contato_email.html', context,
                           [settings.CONTACT_EMAIL])
Example #9
0
def post_save_announcement(instance, created, **kwargs):
    if created:
        subject = instance.title
        context = {'announcement': instance}
        template_name = 'courses/announcement_mail.html'
        enrollments = Enrollment.objects.filter(course=instance.course,
                                                status=1)
        for enrollment in enrollments:
            recipient_list = [enrollment.user.email]
            send_mail_template(subject, template_name, context, recipient_list)
Example #10
0
 def save(self):
     user = Usuario.objects.get(email=self.cleaned_data['username'])
     key = generate_hash_key(user.username)
     reset = NovaSenha(key=key, user=user)
     reset.save()
     base_url = self.scheme + "://" + self.get_host()
     template_name = 'accounts/reset_senha_mail.html'
     subject = 'Criar nova Senha no Defesas Ufba'
     context = {'reset': reset, 'base_url': base_url}
     send_mail_template(subject, template_name, context, [user.username])
Example #11
0
 def send_mail(self, course):
     subject = '[%s] Contato' % course
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message'],
     }
     template_name = 'courses/contact_email.html'
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
Example #12
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     template_name = 'accounts/password_reset_mail.html'
     subject = 'Criar nova senha ProxyManagerWeb'
     context = {
         'reset': reset,
     }
     mail.send_mail_template(subject, template_name, context, [user.email])
Example #13
0
 def save(self):
     context = {}
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     # Enviar Email
     template_email = 'accounts/password_reset_mail.html'
     subject = 'Recuperar Senha na GReAT'
     context['reset']  = reset
     send_mail_template(subject, template_email, context, [user.email])
Example #14
0
    def send_mail(self):
        subject = 'Cadastro PetShop Alibaba'
        context = {
            'name': self.cleaned_data['name'],
            'email': self.cleaned_data['email'],
            'password': self.cleaned_data['password1']
        }
        template_name = 'funcionarios/register_mail.html'
        send_mail_template(subject, template_name, context, [context['email']], settings.CONTACT_EMAIL)

        return (context['email'])
Example #15
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     template_name = 'accounts/password_reset_mail.html'
     subject = 'Criar nova senha no Simple MOOC'
     context = {
         'reset': reset,
     }
     send_mail_template(subject, template_name, context, [user.email])
Example #16
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = SenhaReset(key=key, user=user)
     reset.save()
     template_name = 'conta/password_reset_mail.html'
     subject = 'Criar nova senha no MammonTrading'
     context = {
         'reset': reset,
     }
     send_mail_template(subject, template_name, context, [user.email])
Example #17
0
 def send_mail(self, nombre):
     subject = 'INTERESADO EN LOS CURSOS DE PYTHON'
     context = {
         'nombre': self.cleaned_data['nombre'],
         'email': self.cleaned_data['email'],
         'telefono': self.cleaned_data['telefono'],
         'mensaje': self.cleaned_data['mensaje'],
     }
     template_name = 'contact_email.html'
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
Example #18
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     redefinir = RedefinirSenha(key=key, nome=user)
     redefinir.save()
     template_name = 'accounts/redefinir_senha_email.html'
     context = {
         'redefinir': redefinir  #o que será passado como parametro
     }
     subject = 'Criar nova senha no simplemooc'
     send_mail_template(subject, template_name, context, [user.email])
Example #19
0
 def save(self, commit=True):
     user = super(UserCreateForm, self).save(commit=False)
     password = generate_password()
     user.set_password(password)
     if commit:
         user.save()
         template_name = 'users/create_user_mail.html'
         subject = 'Login no sistema de controle de patrimônio'
         context = {'user': user, 'password': password}
         send_mail_template(subject, template_name, context, [user.email])
     return user
Example #20
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     template_name = 'password_reset_mail.html'
     subject = 'TâmerMOOC - Resete sua senha'
     context = {
         'reset': reset,
     }
     send_mail_template(subject, template_name, context, [user.email])
Example #21
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     template_name = 'accounts/password_reset_mail.html'
     subject = 'Create new password on DevXpand'
     context = {
         'reset': reset,
     }
     send_mail_template(subject, template_name, context, [user.email])
Example #22
0
 def send_mail(self, course):
     subject = '[%s] Contato' % course
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message'],
     }
     template_name = "courses/contact_email.html"
     send_mail_template(
         subject, template_name, context, [settings.CONTACT_EMAIL]
     )
Example #23
0
 def send_mail(self):
     subject = 'Contato'
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'telefone': self.cleaned_data['telefone'],
         'subject': self.cleaned_data['subject'],
         'message': self.cleaned_data['message'],
     }
     template_name = 'contact_email.html'
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
Example #24
0
	def send_mail(self):
		subject = 'Contato do Meu Site'
		context = {
			'name': self.cleaned_data['name'],
			'email': self.cleaned_data['email'],
			'subject': self.cleaned_data['subject'],
			'message': self.cleaned_data['message'],
		}
		template_name = 'contato_email.html'
		email = self.cleaned_data['email']

		send_mail_template(subject, template_name, context, ["*****@*****.**"],email)
Example #25
0
def post_save_announcement(instance, created, **kwargs):
    if created:
        subject = instance.title
        context = {
            'announcement': instance
        }
        template_name = 'courses/announcement_mail.html'
        enrollments = Enrollment.objects.filter(
            course=instance.course, status=1
        )
        for enrollment in enrollments:
            recipient_list = [enrollment.user.email]
            send_mail_template(subject, template_name, context, recipient_list)
Example #26
0
def reset_senha(request):

    form = ResetSenhaForm(request.POST or None)
    context = {}
    if form.is_valid():
        user = Usuario.objects.get(username=form.cleaned_data['username'])
        key = generate_hash_key(user.username)
        reset = NovaSenha(key=key, user=user)
        reset.save()
        base_url = request.scheme + "://" + request.get_host()
        template_name = 'accounts/reset_senha_mail.html'
        subject = 'Criar nova Senha no Defesas Ufba'
        context = {'reset': reset, 'base_url': base_url}
        send_mail_template(subject, template_name, context, [user.username])
        context['success'] = True

        return redirect('accounts:login')

    template_name = 'accounts/reset_senha.html'
    context['form'] = form
    return render(request, template_name, context)