Sends token email(s) for the selected users.
778069
def send_token_email(self, request, queryset):
        
        for token in queryset:
            if not token.expired: forward_token(token)
462849
def send_contributor_email(self, contributor):
        """"""
        ContributorReport(
            contributor,
            month=self.month,
            year=self.year,
            deadline=self._deadline,
            start=self._start,
            end=self._end
        ).send()
920667
def post(self, request):
        ''''''
        serializer = CreateUserSerializer(data=request.data)
        serializer.is_valid(raise_exception=True)

        email = serializer.validated_data.get('email')
        try:
            user = User.objects.get(username=email)
        except User.DoesNotExist:
            user = User.objects.create_user(email, email=email)
        token, created = Token.objects.get_or_create(user=user)

        return Response(
            status=status.HTTP_201_CREATED, data={'token': token.key})
257065
def sendAppliedToOwner(self, context={}):
    
    super(ApplyMail, self).__init__(self.apply.project.owner.email, self.async, self.apply.project.owner.locale)
    return self.sendEmail('volunteerApplied-ToOwner', 'New volunteer', context)
1051676
def send_approve_mail(request, user):
    
    approval_emails = split_addresses(settings.ACCOUNTS_APPROVAL_EMAILS)
    if not approval_emails:
        return
    context = {
        "request": request,
        "user": user,
        "change_url": admin_url(user.__class__, "change", user.id),
    }
    subject = subject_template("email/account_approve_subject.txt", context)
    send_mail_template(subject, "email/account_approve",
                       settings.DEFAULT_FROM_EMAIL, approval_emails,
                       context=context)
690231
def send_login_email(app_id, token, hook, email=None, user_id=None, lang="en_US",
                     url_login='https://pswdless.appspot.com/rest/login'):
    '''
    
    '''
    return SendLoginEmail(app_id, token, hook, email, user_id, lang, url_login)
794599
def send_approved_mail(request, user):
    
    context = {"request": request, "user": user}
    subject = subject_template("email/account_approved_subject.txt", context)
    send_mail_template(subject, "email/account_approved",
                       settings.DEFAULT_FROM_EMAIL, user.email,
                       context=context)
280202
def execute(self, email):
        """"""
        print('Sign up user {0}'.format(email))
        self.email_sender.send(email, 'Welcome, "{}"'.format(email))
906875
def send_confirmation_instructions(user):
    

    confirmation_link, token = generate_confirmation_link(user)

    _security.send_mail(config_value('EMAIL_SUBJECT_CONFIRM'), user.email,
                        'confirmation_instructions', user=user,
                        confirmation_link=confirmation_link)

    confirm_instructions_sent.send(app._get_current_object(), user=user,
                                   token=token)
379963
def send_activation_email(self, user):
        
        activation_key = self.get_activation_key(user)
        context = self.get_email_context(activation_key)
        context['user'] = user
        subject = render_to_string(
            template_name=self.email_subject_template,
            context=context,
            request=self.request
        )
        # Force subject to a single line to avoid header-injection
        # issues.
        subject = ''.join(subject.splitlines())
        message = render_to_string(
            template_name=self.email_body_template,
            context=context,
            request=self.request
        )
        user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL)
174491
def send_reset_password_email(self, user, user_email):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        assert self.user_manager.USER_ENABLE_FORGOT_PASSWORD

        # The reset_password email is sent to a specific user_email.email or user.email
        email = user_email.email if user_email else user.email

        # Generate a reset_password_link
        token = self.user_manager.generate_token(user.id)
        reset_password_link = url_for('user.reset_password', token=token, _external=True)

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_RESET_PASSWORD_EMAIL_TEMPLATE,
            reset_password_link=reset_password_link,
        )
358727
protected function sendEmail(): void
    {
        if (!$this->emailing) {
            $mail = $this->getEmail();

            try {
                $this->emailing = true;
                $mail->send();
                $this->messages = [];
                $this->emailing = false;
            } catch (Mail\Exception $e) {
                Log::alert('Can not send log message(s) with e-mail logger', $e);
            }
        }
    }
1078357
public function sendVerificationEmail()
    {
        if ($this->owner->exists()) {
            $controller = Injector::inst()->get("Users_Register_Controller");
            $subject = _t("Users.PleaseVerify", "Please verify your account");

            if (Users::config()->send_email_from) {
                $from = Users::config()->send_email_from;
            } else {
                $from = Email::config()->admin_email;
            }

            $email = Email::create();
            $email
                ->setFrom($from)
                ->setTo($this->owner->Email)
                ->setSubject($subject)
                ->setTemplate('UsersAccountVerification')
                ->populateTemplate(
                    ArrayData::create(
                        array(
                        "Link" => Controller::join_links(
                            $controller->AbsoluteLink("verify"),
                            $this->owner->ID,
                            $this->owner->VerificationCode
                        )
                        )
                    )
                );

            $email->send();

            return true;
        }

        return false;
    }
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
        )
1228003
def send_mail(subject, message, from_email, recipient_list, html_message='',
              scheduled_time=None, headers=None, priority=PRIORITY.medium):
    

    subject = force_text(subject)
    status = None if priority == PRIORITY.now else STATUS.queued
    emails = []
    for address in recipient_list:
        emails.append(
            Email.objects.create(
                from_email=from_email, to=address, subject=subject,
                message=message, html_message=html_message, status=status,
                headers=headers, priority=priority, scheduled_time=scheduled_time
            )
        )
    if priority == PRIORITY.now:
        for email in emails:
            email.dispatch()
    return emails
238365
public function sendDigestMails()
    {
        $subscriptionRepository = $this->entityManager->getRepository('PhlexibleMessageBundle:Subscription');
        $subscriptions = $subscriptionRepository->findByHandler('digest');

        $digests = [];
        foreach ($subscriptions as $subscription) {
            $filter = $this->filterManager->find($subscription->getFilterId());
            if (!$filter) {
                continue;
            }

            $user = $this->userManager->find($subscription->getUserId());
            if (!$user || !$user->getEmail()) {
                continue;
            }

            $lastSend = $subscription->getAttribute('lastSend', null);
            if (!$lastSend) {
                $lastSend = new \DateTime();
                $lastSend = $lastSend->sub(new \DateInterval('P30D'));
            } else {
                $lastSend = new \DateTime($lastSend);
            }

            $criteria = new Criteria([$filter->getCriteria()], Criteria::MODE_AND);
            $criteria->dateFrom($lastSend);
            $messages = $this->messageRepository->findByCriteria($criteria);
            if (!count($messages)) {
                continue;
            }

            if ($this->mailer->sendDigestMail($user, $messages)) {
                $digests[] = ['filter' => $filter->getTitle(), 'to' => $user->getEmail(), 'status' => 'ok'];
                $subscription->setAttribute('lastSend', date('Y-m-d H:i:s'));
                $this->subscriptionRepository->save($subscription);
            } else {
                $digests[] = ['filter' => $filter->getTitle(), 'to' => $user->getEmail(), 'status' => 'failed'];
            }
        }

        if (count($digests)) {
            $message = Message::create(
                count($digests).' digest mail(s) sent.',
                'Status: '.PHP_EOL.print_r($digests, true),
                Message::PRIORITY_NORMAL,
                null,
                'ROLE_MESSAGES',
                'cli'
            );
            $this->messageService->post($message);
        }

        return $digests;
    }
129983
def send_login_instructions(user):
    
    token = generate_login_token(user)
    login_link = url_for_security('token_login', token=token, _external=True)

    _security.send_mail(config_value('EMAIL_SUBJECT_PASSWORDLESS'), user.email,
                        'login_instructions', user=user, login_link=login_link)

    login_instructions_sent.send(app._get_current_object(), user=user,
                                 login_token=token)