Constructs :py:class:`Email` instance.

        :return: :py:class:`Email`
168808
def Email(
        self,
        From,
        To,
        Cc=None,
        Bcc=None,
        Subject=None,
        Tag=None,
        HtmlBody=None,
        TextBody=None,
        Metadata=None,
        ReplyTo=None,
        Headers=None,
        TrackOpens=None,
        TrackLinks="None",
        Attachments=None,
    ):
        
        return Email(
            manager=self,
            From=From,
            To=To,
            Cc=Cc,
            Bcc=Bcc,
            Subject=Subject,
            Tag=Tag,
            HtmlBody=HtmlBody,
            TextBody=TextBody,
            Metadata=Metadata,
            ReplyTo=ReplyTo,
            Headers=Headers,
            TrackOpens=TrackOpens,
            TrackLinks=TrackLinks,
            Attachments=Attachments,
        )
559256
def verify(self, email):
        
        resp = self._call(endpoint='single', data={'email': email})
        return VerifiedEmail(email, resp['result'])
1264989
def copy(self):
        
        return self.__class__(options=self.__options,
                              attribute_options=self.__attribute_options)
688860
def clean_email(self):
        
        if get_user_model().objects.filter(
            email__iexact=self.cleaned_data['email']):
            raise forms.ValidationError(_('This email is already in use. Please supply a different email.'))
        return self.cleaned_data['email']
1212257
def email_secure(self):
        
        email = self._email
        if not email: return ''
        address, host = email.split('@')
        if len(address) <= 2: return ('*' * len(address)) + '@' + host

        import re
        host = '@' + host
        obfuscated = re.sub(r'[a-zA-z0-9]', '*', address[1:-1])
        return address[:1] + obfuscated + address[-1:] + host
90847
def email_message(
        self,
        user,
        subject_template,
        body_template,
        sender=None,
        message_class=EmailMessage,
        **kwargs
    ):
        
        if sender:
            try:
                display_name = sender.get_full_name()
            except (AttributeError, TypeError):
                display_name = sender.get_username()
            from_email = "%s <%s>" % (
                display_name, email.utils.parseaddr(settings.DEFAULT_FROM_EMAIL)[1]
            )
            reply_to = "%s <%s>" % (display_name, sender.email)
        else:
            from_email = settings.DEFAULT_FROM_EMAIL
            reply_to = from_email

        headers = {"Reply-To": reply_to}
        kwargs.update({"sender": sender, "user": user})

        subject_template = loader.get_template(subject_template)
        body_template = loader.get_template(body_template)
        subject = subject_template.render(
            kwargs
        ).strip()  # Remove stray newline characters
        body = body_template.render(kwargs)
        return message_class(subject, body, from_email, [user.email], headers=headers)
92472
def options(self):
        
        config = self._config
        o = {}
        o.update(self._default_smtp_options)
        o.update(self._default_message_options)
        o.update(self._default_backend_options)
        o.update(get_namespace(config, 'EMAIL_', valid_keys=o.keys()))
        o['port'] = int(o['port'])
        o['timeout'] = float(o['timeout'])
        return o
724017
def create(cls, name, email, cb):
        
        it = cls(name, create_structure=True)
        it.value['email'] = email

        # In an actual application you'd probably want to use 'add',
        # but since this app might be run multiple times, you don't
        # want to get KeyExistsError
        cb.upsert_multi(ItemSequence([it]))
        return it
591895
public function _construct()
    {
        $this->_init(
            \Dotdigitalgroup\Email\Model\Importer::class,
            \Dotdigitalgroup\Email\Model\ResourceModel\Importer::class
        );
    }
1130767
def findUserByEmail(email)
      method = 'findUser'
      type = User
      args = {:email=>email}
      return_object type,method,args
    end
51296
def clean(self):
        
        super().clean()
        self.email = self.__class__.objects.normalize_email(self.email)
323608
def send_email_template(slug, base_url=None, context=None, user=None,
                       to=None, cc=None, bcc=None, attachments=None, headers=None, connection=None, fail_silently=False):
    
    email_template = EmailTemplate.objects.get_for_slug(slug)

    email = email_template.get_email_message(
        base_url, context, user,
        to=to, cc=cc, bcc=bcc,
        attachments=attachments, headers=headers, connection=connection
    )

    return email.send(fail_silently=fail_silently)
26624
def login(self, email, password):
        
        rsp = self._request()
        self.default_headers['Authorization'] = rsp.data['token']
        return rsp
394808
def add_to_emails(self, *emails):
        
        assert all(isinstance(element, (str, unicode)) for element in emails), emails
        post_parameters = emails
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            "/user/emails",
            input=post_parameters
        )
1263367
def send_email(self, to, subject, content, files=None):
        
        msg = EmailSender._construct_msg(self, to, subject, content, files=files)
        try:
            self.smtp.sendmail(self.from_, to, str(msg))
        except:
            self.login()
            self.smtp.sendmail(self.from_, to, str(msg))
420929
def construct(self):
        ''''''
        if self.__construct is None:
            self.__construct = self._construct()
        return self.__construct
730967
def get_instance(self):
        
        try:
            return self._instance
        except AttributeError:
            self._instance = self._decorated()
            return self._instance