Esempio n. 1
0
 def send(self, **kwargs):
     current_site = kwargs["site"] if "site" in kwargs else Site.objects.get_current()
     protocol = getattr(settings, "DEFAULT_HTTP_PROTOCOL", "http")
     activate_url = "{0}://{1}{2}".format(
         protocol, current_site.domain, reverse("account_confirm_email", args=[self.key])
     )
     ctx = {
         "email_address": self.email_address,
         "user": self.email_address.user,
         "activate_url": activate_url,
         "current_site": current_site,
         "key": self.key,
     }
     hookset.send_confirmation_email([self.email_address.email], ctx)
     self.sent = timezone.now()
     self.save()
     signals.email_confirmation_sent.send(sender=self.__class__, confirmation=self)
Esempio n. 2
0
 def send(self, **kwargs):
     protocol = getattr(settings, "DEFAULT_HTTP_PROTOCOL", "http")
     current_site = kwargs.get("site")
     activate_url = "{0}://{1}{2}".format(
         protocol,
         current_site.domain,
         reverse(settings.ACCOUNT_EMAIL_CONFIRMATION_URL, args=[self.key])
     )
     ctx = {
         "email_address": self.email_address,
         "user": self.email_address.user,
         "activate_url": activate_url,
         "current_site": current_site,
         "key": self.key,
     }
     hookset.send_confirmation_email([self.email_address.email], ctx)
     self.sent = timezone.now()
     self.save()
     signals.email_confirmation_sent.send(sender=self.__class__, confirmation=self)