コード例 #1
0
ファイル: forms.py プロジェクト: antoniomalves/simplemooc
    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]
        )

    # Envio antigo, sem o uso de template
    # def send_mail(self, course):
    #     subject = '[%s] Contato' % course
    #     message = 'Nome: %(name)s;E-mail: %(email)s;%(message)s'
    #     context = {
    #         'name': self.cleaned_data['name'],
    #         'email': self.cleaned_data['email'],
    #         'message': self.cleaned_data['message'],
    #     }
    #     message = message % context
    #     send_mail(
    #         subject, message, settings.DEFAULT_FROM_EMAIL, 
    #         [settings.CONTACT_EMAIL]
    #     )
コード例 #2
0
def post_save_announcement(instance, created, **kwargs):
    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)
コード例 #3
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(kay=key, user=user)
     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])
コード例 #4
0
ファイル: forms.py プロジェクト: Dedaldino3D/simplemooc
 def save(self):
     template_name = 'accounts/password_reset_mail.html'
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(user.username)
     reset = PasswordReset(key=key, user=user)
     reset.save()
     context = {'reset': reset}
     subject = _('Criar nova senha para a sua conta do SimpleMooc')
     send_mail_template(subject, template_name, context, [user.email])
コード例 #5
0
ファイル: forms.py プロジェクト: Raffae2679/SimpleMoocProject
	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] )
コード例 #6
0
ファイル: models.py プロジェクト: leandrobraga/simplemooc
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)
コード例 #7
0
ファイル: forms.py プロジェクト: mamgjunior/simplemooc
 def send_mail(self, course):
     subject = "[%s] Contato" % course
     message = "Nome: %(name)s;Email: %(email)s;%(message)s"
     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])
コード例 #8
0
ファイル: forms.py プロジェクト: leandrobraga/simplemooc
    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_email.html"
        subject = "Criar nova senha no simplemooc"
        context = {'reset': reset}
        send_mail_template(subject, template_name, context, [user.email])
コード例 #9
0
ファイル: models.py プロジェクト: paulo-sergi0/simplemooc
def post_save_announcement(instance, created, **kwargs):
    if created:  #para enviar o e-mail apenas quando o anuncio for criado (e não sempre que for atualizado)
        subject = instance.title
        context = {'announcement': instance}
        template_name = 'courses/announcements_mail.html'
        enrollements = Enrollment.objects.filter(course=instance.course,
                                                 status=1)
        for enrollement in enrollements:  #Laço incluído para não não lançar apenas um e-mail para todos os usuários(que poderia ser feito passando a lista dos e-mails, porém os e-mails ficaram em copia(do e-mail)).
            recipient_list = [enrollement.user.email]
            send_mail_template(subject, template_name, context, recipient_list)
コード例 #10
0
 def send_mail(self, course):
     subject = 'Contato sobre o curso {}'.format(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])
コード例 #11
0
ファイル: form.py プロジェクト: mamgjunior/simplemooc
 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])
コード例 #12
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'
     # Chama a função send_mail_template que foi definida no core do projeto simplemooc
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
コード例 #13
0
 def send_email(self):
     subject='Contato sobre o curso'
     message='Nome: %(name)s;Email: %(email)s;%(message)s'
     context = {
         'name':self.cleaned_data['name'],
         'email':self.cleaned_data['email'],
         'message':self.cleaned_data['message'],
     }
     template_name = 'courses/contact_email.html'
     message = message % context
     send_mail_template(subject, template_name, context, [settings.CONTACT_EMAIL])
コード例 #14
0
ファイル: forms.py プロジェクト: andresgomes/simplemooc
	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]
		)
コード例 #15
0
 def send_mail(self, course):
     subject = 'Dúvida Sobre: [%s]' % course.name
     message = 'Nome: %(name)s;\nE-mail: %(email)s;\n%(message)s'
     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])
コード例 #16
0
ファイル: forms.py プロジェクト: knuxbbs/simplemooc
    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']
        }

        send_mail_template(subject, 'courses/contact_mail.html', context,
                           [context['email']])
コード例 #17
0
ファイル: models.py プロジェクト: JoberthDavid/simplemooc
def post_save_announcement(instance, created, **kwargs):
	if created: #caso o anúncio tenha sido criado faça
		subject = instance.title
		template_name = 'courses/announcement_mail.html'
		context = {
			'announcement':instance
		}
		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)
コード例 #18
0
ファイル: forms.py プロジェクト: helderjosex/django-projects
 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 = 'Criar nova senha no Simple MOOC'
     context = {
         'reset': reset,
     }
     send_mail_template(subject, template_name, context, [user.email])
コード例 #19
0
ファイル: forms.py プロジェクト: ViniciusX22/simplemooc
 def send_mail(self, course):
     subject = '[%s] Contato' % course
     message = 'Nome: %(name)s;E-mail: %(email)s;%(message)s'
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message'],
     }
     message = message % context
     template_name = 'contact_email.html'
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
コード例 #20
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'
     # Chama a função send_mail_template que foi definida no core do projeto simplemooc
     send_mail_template(
         subject, template_name, context, [settings.CONTACT_EMAIL]
     )
コード例 #21
0
ファイル: forms.py プロジェクト: sadijrp/simplemooc-course
    def send_mail(self, course):
        template_name = "courses/contact_email.html"
        subject = '[%s] Contato' % course

        context = {
            "name": self.cleaned_data["name"],
            "email": self.cleaned_data["email"],
            "msg": self.cleaned_data["msg"]
        }

        send_mail_template(subject, template_name, context,
                           [settings.CONTACT_EMAIL])
コード例 #22
0
 def send_mail(self, courses):
     subject = f'Duvida sobre o curso: {courses}'
     # CAPTURA OS DADOS DIGITADOS NO FORUMALARIO.. ****** VERIFICAR MELHOR
     context = {
         "name": self.cleaned_data['name'],
         "email": self.cleaned_data['email'],
         "message": self.cleaned_data['message']
     }
     template_name = 'courses/contact_email.html'
     # COMANDO PADRONIZADO PARA ENVIAR EMAIL.
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
コード例 #23
0
ファイル: forms.py プロジェクト: leoisf/Simple-MOOC
 def send_mail(self, course):
     subject = '[%s] contato ' % course  #[%s] forma de formatação de mensagens strings em Python (não nomeada lista)
     # desnecesssario. utilizando o template message = 'Nome: %(name)s; E-mail: %(email)s;%(message)s' # %(name)s forma de formatação de mensagens strings em Python (nomeada dicionartio)
     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
                         ])  # envio de e-mail pelo renderizando um template
コード例 #24
0
ファイル: form.py プロジェクト: pdrMottaS/Simplemooc
 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 = 'registration/password_reset_mail.html'
     subject = 'Criar nova senha no Simple MOOC'
     context = {'reset': reset}
     send_mail_template(subject=subject,
                        template_name=template_name,
                        context=context,
                        recipient_list=[user.email])
コード例 #25
0
ファイル: forms.py プロジェクト: diogo-alves/simplemooc
 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()
     subject = 'Criar nova senha no Simple MOOC'
     template_name = 'accounts/password_reset_email.html'
     context = {
         'reset': reset,
         'domain': settings.EMAIL_LINK_DOMAIN
     }
     send_mail_template(subject, template_name, context, [user.email])
コード例 #26
0
    def send_mail(self, course):
        """
        Definindo envio de email
        """
        subject = f'[{course}] | Contato'

        # Enviando email usando template (criado em core/mail.py)
        send_mail_template(
            subject,
            'courses/contact_email.html',
            self.cleaned_data,
            [settings.CONTACT_EMAIL]
        )
コード例 #27
0
 def send_mail(self, course):
     subject = '[%s] - Contato' % course
     #message = 'Nome: %(name)s; Email: %(email)s; %(message)s'
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message'],
     }
     #message = message % context
     #send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [settings.CONTACT_EMAIL])
     template_name = 'courses/contact_email.html'
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
コード例 #28
0
ファイル: forms.py プロジェクト: paulo-sergi0/simplemooc
 def save(self):
     user = User.objects.get(
         email=self.cleaned_data['email']
     )  #o .get é um filer que retorna apenas obejetos, se não retornar nada é gerada um execção
     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])
コード例 #29
0
ファイル: forms.py プロジェクト: nenodias/neno-simplemooc
 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'
     domain = self.request.build_absolute_uri('/')[:-1]
     subject = 'Criar nova senha no SimpleMooc'
     context = {
         'reset': reset,
         'domain': domain
     }
     send_mail_template(subject, template_name, context, [ user.email ])
コード例 #30
0
ファイル: forms.py プロジェクト: anderson89marques/simplemooc
    def save(self):
        user = User.objects.get(email=self.cleaned_data['email'])
        key = generate_hash_key(user.email)
        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=subject,
                           template_name=template_name,
                           context=context,
                           recipient_list=[user.email])
コード例 #31
0
ファイル: forms.py プロジェクト: leandrobraga/simplemooc
    def send_mail(self, course):

        subject = '[%s] Contato' % course
        #message = 'Nome: %(name)s;E-mail: %(email)s;%(message)s'
        context = {
            'name': self.cleaned_data['name'],
            'email': self.cleaned_data['email'],
            'message': self.cleaned_data['message'],

        }
        template_name = "courses/contact_email.html"
        #message = message % context
        #send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [settings.CONTACT_EMAIL])
        send_mail_template(subject, template_name, context, [settings.CONTACT_EMAIL])
コード例 #32
0
ファイル: models.py プロジェクト: mazulo/simplemooc
def post_save_announcement(instance, created, **kwargs):
    subject = instance.title
    context = {
        'announcement': instance,
    }
    template_name = 'courses/announcement_mail.html'
    # import ipdb; ipdb.set_trace()
    content_type = ContentType.objects.get_for_model(instance)
    enrollments = Enrollment.objects.filter(
        content_type=content_type, status=1
    )
    for enrollment in enrollments:
        recipient_list = [enrollment.user.email]
        send_mail_template(subject, template_name, context, recipient_list)
コード例 #33
0
ファイル: forms.py プロジェクト: iamgilvan/simplemooc
 def send_mail(self, course):
     subject = '[%s] Contato' % course
     #message = 'Nome: %(name)s;E-mail: %(email)s;%(message)s'
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message'],
     }
     #message = message % context
     template_name = 'courses/contact_email.html'
     #Utilizando email de usuário cadastrado
     mailto = self.cleaned_data['email']
     #send_mail(subject,message,settings.DEFAULT_FROM_EMAIL,[mailto])
     send_mail_template(subject, template_name, context, [mailto])
コード例 #34
0
 def save(self):
     user = User.objects.get(email=self.cleaned_data['email'])
     key = generate_hash_key(
         user.username
     )  # Gera a chave passando o username como salt e atribui a key
     reset = PasswordReset(key=key,
                           user=user)  # Recebe a chave já criptogravada
     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])
コード例 #35
0
ファイル: forms.py プロジェクト: Akijunior/Eleanning
 def send_mail(self, course):
     '''
         Resposansavél pelo envio de email
     '''
     subject = '[%s] Contato' % course
     context = {
         'nome': self.cleaned_data['nome'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message']
     }
     template_name = 'courses/contact_email.html'
     #message = message % context
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])
コード例 #36
0
    def send_email(self, course):
        subject = '[%s] Contato' % course # Título da menssagem, "assunto"
        context = { # tupla definida para implementar e menssagem
            'name': self.cleaned_data['name'],
            'email': self.cleaned_data['email'],
            'message': self.cleaned_data['message']
        }

        send_mail_template( # esta função irá enviar um email automático definido acima, muitas possibilidades.
            subject,
            'courses/contact_email.html',
            context,
            [settings.CONTACT_EMAIL]
        )
コード例 #37
0
ファイル: forms.py プロジェクト: anderson89marques/simplemooc
    def send_mail(self, course):
        subject = '[{}] Contato'.format(course)
        context = {
            'name': self.cleaned_data['name'],
            'email': self.cleaned_data['email'],
            'msg': self.cleaned_data['message']
        }

        to = [settings.CONTACT_EMAIL]
        template_name = 'courses/mail.html'

        send_mail_template(subject=subject,
                           template_name=template_name,
                           context=context,
                           recipient_list=to)
コード例 #38
0
 def send_mail(self, course):
     subject = '[%s] Contato ' % course
     #message = 'Nome: %(name)s; E-mail: %(email)s; %(message)s'
     #Criado o contexto atribuindo valor para as variaveis nomeadas 
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message'],
     }
     #aplicando o contexto a menssagem criada.
     #message = message % context
     #send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [settings.CONTACT_EMAIL])
     template_name = 'courses/contact_email.html'
     send_mail_template(
         subject, template_name, context, [settings.CONTACT_EMAIL]
     )
コード例 #39
0
ファイル: forms.py プロジェクト: paulo-sergi0/simplemooc
 def send_mail(self, course):
     subject = '[%s] Contato' % course
     #message = 'Nome: %(name)s; Email: %(email)s; Mensagem: %(message)s'
     ##message = 'Nome: %s; Email: %s; Mensagem: %s' #Forma sem nomeação é passada uma lista. Com nomeação (linha acima) é passado um dicionário
     context = {
         'name': self.cleaned_data['name'],
         'email': self.cleaned_data['email'],
         'message': self.cleaned_data['message'],
     }
     #message = message % context
     #send_mail(
     #    subject, message, settings.DEFAULT_FROM_EMAIL,
     #    [settings.CONTACT_EMAIL]
     #)
     template_name = 'courses/contact_email.html'
     send_mail_template(subject, template_name, context,
                        [settings.CONTACT_EMAIL])