recipients can be either a list of emails or a list of users,
        if it is users the system will change to the language that the
        user has set as theyr mother toungue
547568
def send_templated_email(recipients, template_path, context=None,
                    from_email=settings.DEFAULT_FROM_EMAIL,
                    fail_silently=False, extra_headers=None):
    
    recipient_pks = [r.pk for r in recipients if isinstance(r, get_user_model())]
    recipient_emails = [e for e in recipients if not isinstance(e, get_user_model())]
    send = _send_task.delay if use_celery else _send
    msg = send(recipient_pks, recipient_emails, template_path, context, from_email,
         fail_silently, extra_headers=extra_headers)

    return msg
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
        )
297327
def call
      return recipients unless mailable.respond_to?(:conversation)

      recipients.each_with_object([]) do |recipient, array|
        array << recipient if mailable.conversation.has_subscriber?(recipient)
      end
    end
518342
def get_email_template(name, language=''):
    
    use_cache = getattr(settings, 'POST_OFFICE_CACHE', True)
    if use_cache:
        use_cache = getattr(settings, 'POST_OFFICE_TEMPLATE_CACHE', True)
    if not use_cache:
        return EmailTemplate.objects.get(name=name, language=language)
    else:
        composite_name = '%s:%s' % (name, language)
        email_template = cache.get(composite_name)
        if email_template is not None:
            return email_template
        else:
            email_template = EmailTemplate.objects.get(name=name,
                                                       language=language)
            cache.set(composite_name, email_template)
            return email_template
823129
public function setEmailAddress($email_user, $lang = 'en')
    {
        $action = "set_email_user";
        $options = array(
            'email_user' => $email_user,
            'lang' => $lang,
            'sid_token' => $this->sid_token
        );

        return $this->client->post($action, $options);
    }
1191719
function doUserLanguage(Userinfo $userinfo, Userinfo &$existinguser)
	{
		$changed = false;
		//Update the user language with the current used in Joomla or the one existing from an other plugin
		if (empty($userinfo->language)) {
			$user_lang = '';
			if (!empty($userinfo->params)) {
				$params = new Registry($userinfo->params);
				$user_lang = $params->get('language');
			}
			$userinfo->language = !empty($user_lang) ? $user_lang : Factory::getLanguage()->getTag();
		}
		if (!empty($userinfo->language) && isset($existinguser->language) && !empty($existinguser->language) && $userinfo->language != $existinguser->language) {
			try {
				$this->updateUserLanguage($userinfo, $existinguser);
				$existinguser->language = $userinfo->language;
				$this->debugger->addDebug(Text::_('LANGUAGE_UPDATED') . ' : ' . $existinguser->language . ' -> ' . $userinfo->language);

				$changed = true;
			} catch (Exception $e) {
				$this->debugger->addError(Text::_('LANGUAGE_UPDATED_ERROR') . ' ' . $e->getMessage());
			}
		} else {
			//return a debug to inform we skipped this step
			$this->debugger->addDebug(Text::_('LANGUAGE_NOT_UPDATED'));
		}
		return $changed;
	}
125988
def issues(self, kind, email):
        
        return list(set([unicode(activity.issue)
            for activity in self.activities()
            if kind == activity.kind and activity.user['email'] == email]))
1143606
function(apiKey, contactId, fromName,
        fromAddress, toAddress, ccAddresses, bccAddresses, contentType,
        subject, htmlBody, textBody, header, receivedDate, sentDate,
        emailSentType) {}
328672
function set_user_data($id, $email=null, $data=[])
    {
        $user = array('id' => $id);
        if (isset($email)) {
            $user['email'] = $email;
        }
        $this->user_context(array_merge($user, $data));
    }
854712
def emails(text):
    ''''''
    return imap(lambda m: m.group(0).lower(), REGEX_EMAIL.finditer(text))
1177079
@Override
    public Response recipients(Iterable<String> usernames) {
    	this.usernames.addAll(Sets.newHashSet(usernames));
    	return this;
    }
726708
def delete_user(self, recipient_email):
        
        emailid_list = self.list_user_emails()
        if recipient_email not in emailid_list:
            raise Exception("User {0} not present!".format(recipient_email))
        else:
            emailid_list.remove(recipient_email)
            self.y = self.decrypt()
            self.encrypt(emailid_list=emailid_list)
1170764
def recipients(self):
        '''
        '''
        cc = self._cc or []
        bcc = self._bcc or []
        return self._to + cc + bcc
914733
def send(self, to, language=None, **data):
        
        self.data = data
        self.get_context_data()
        if app_settings['SEND_EMAILS']:
            try:
                if language:
                    mail.send(to, template=self.template, context=self.context_data, language=language)
                else:
                    mail.send(to, template=self.template, context=self.context_data)
            except EmailTemplate.DoesNotExist:
                msg = 'Trying to use a non existent email template {0}'.format(self.template)
                LOGGER.error('Trying to use a non existent email template {0}'.format(self.template))
620115
def send_outlook_email(to, subject, body, attachments=None, cc=None, bcc=None, is_html=0):
    
    import win32com.client
    asarr = lambda v: None if not v else isinstance(v, basestring) and [v] or v
    def update_recipients(robj, users, type):
        users = asarr(to)
        if users:
            for u in users:
                r = robj.Add(u)
                r.Type = type

    outlook = win32com.client.gencache.EnsureDispatch("Outlook.Application")
    mapi = outlook.GetNamespace("MAPI")
    constants = win32com.client.constants
    msg = outlook.CreateItem(0)
    # setup the recipients
    recipients = msg.Recipients
    to and update_recipients(recipients, to, constants.olTo)
    cc and update_recipients(recipients, cc, constants.olCC)
    bcc and update_recipients(recipients, bcc, constants.olBCC)
    recipients.ResolveAll()
    msg.Subject = subject
    if is_html:
        msg.BodyFormat = constants.olFormatHTML
        msg.HTMLBody = body
    else:
        msg.Body = body

    map(lambda fpath: msg.Attachments.Add(fpath), attachments or [])
    msg.Send()
1048134
public void setUserEmailList(java.util.Collection<String> userEmailList) {
        if (userEmailList == null) {
            this.userEmailList = null;
            return;
        }

        this.userEmailList = new java.util.ArrayList<String>(userEmailList);
    }
253749
def user_parse(data):
        """"""
        for email in data.get('emails', []):
            if email.get('primary'):
                yield 'id', email.get('email')
                yield 'email', email.get('email')
                break