Populates the ``email_addresses`` field using the 595 MARCXML field.

    Also populates ``_private_notes`` as a side effect.
326949
def email_addresses595(self, key, value):
    
    emails = self.get('email_addresses', [])

    if value.get('o'):
        emails.append({
            'value': value.get('o'),
            'current': False,
            'hidden': True,
        })

    if value.get('m'):
        emails.append({
            'value': value.get('m'),
            'current': True,
            'hidden': True,
        })

    notes = self.get('_private_notes', [])
    new_note = (
        {
            'source': value.get('9'),
            'value': _private_note,
        } for _private_note in force_list(value.get('a'))
    )
    notes.extend(new_note)
    self['_private_notes'] = notes

    return emails
1210717
def _get_addresses(self, address_data, retain_name=False):
        
        if retain_name:
            raise NotImplementedError(
                "Not yet implemented, but will need client-code changes too"
            )

        # We trust than an email address contains an "@" after
        # email.utils.getaddresses has done the hard work. If we wanted
        # to we could use a regex to check for greater email validity

        # NB: getaddresses expects a list, so ensure we feed it appropriately
        if isinstance(address_data, str):
            if "[" not in address_data:
                # Definitely turn these into a list
                # NB: this is pretty assumptive, but still prob OK
                address_data = [address_data]

        output = [x[1] for x in getaddresses(address_data) if "@" in x[1]]
        return output
854301
def create_mailing_lists(self, verbose=True):
        
        responses = {}
        if (
            settings.EMAIL_ENABLED
            and self.loaded
            and settings.EMAIL_BACKEND
            != "django.core.mail.backends.locmem.EmailBackend"
        ):
            sys.stdout.write(style.MIGRATE_HEADING(f"Creating mailing lists:\n"))
            for name, notification_cls in self.registry.items():
                message = None
                notification = notification_cls()
                manager = MailingListManager(
                    address=notification.email_to,
                    name=notification.name,
                    display_name=notification.display_name,
                )
                try:
                    response = manager.create()
                except ConnectionError as e:
                    sys.stdout.write(
                        style.ERROR(
                            f"  * Failed to create mailing list {name}. " f"Got {e}\n"
                        )
                    )
                else:
                    if verbose:
                        try:
                            message = response.json().get("message")
                        except JSONDecodeError:
                            message = response.text
                        sys.stdout.write(
                            f"  * Creating mailing list {name}. "
                            f'Got {response.status_code}: "{message}"\n'
                        )
                    responses.update({name: response})
        return responses
309916
def _private_notes(self, key, value):
    """"""
    return [
        {
            'source': value.get('9'),
            'value': _private_note,
        } for _private_note in force_list(value.get('x'))
    ]
1012941
def display_names
      list = element.addresses.map { |a| a.display_name }
      Mail::AddressContainer.new(self, list)
    end
342221
private function getAllEmailAddresses($parts, $fields = ['to', 'from', 'cc', 'bcc'])
    {
        $addresses = [];
        foreach ($fields as $field) {
            $addressesPerField = [];
            foreach ($parts as $part) {
                 $addressesPerField = array_merge(
                     $addressesPerField,
                     $this->getAddressesFromFieldInPart($field, $part)
                 );
            }
            $addresses[$field] = $addressesPerField;
        }

        return $addresses;
    }
360687
def addresses
      list = element.addresses.map { |a| a.address }
      Mail::AddressContainer.new(self, list)
    end
1258326
private function AddMailText1Field()
    {
        $name = 'MailText1';
        $this->AddRichTextField($name, $this->changePassword->GetMailText1());
        $this->SetRequired($name);
    }
909146
def auto_share_contact_details
      xml = Builder::XmlMarkup.new
      xml.instruct!
      xml.Request(:xmlns => "urn:sbx:apis:SbxBaseComponents") do |xml|
        connection.requester_credentials_block(xml)
        xml.GetAutoShareContactDetailsCall
      end
      response = connection.post_xml(xml)
      details = Hash.new
      document = REXML::Document.new(response)
      details_element = document.elements["GetAutoShareContactDetailsCallResponse"]
      details[:first_name] = details_element.elements["FirstName"].text
      details[:last_name] = details_element.elements["LastName"].text
      details[:email] = details_element.elements["Email"].text
      details[:additional_contact_info] = details_element.elements["AdditionalContactInfo"].text
      details
    end
999969
def split_addresses(email_string_list):
    
    return [f for f in [s.strip() for s in email_string_list.split(",")] if f]
482398
public function render_email_address() {
		$placeholder = get_bloginfo( 'admin_email' );
		$current = $this->options->email_address;
		$value = $placeholder === $current ? '' : $current;

		echo $this->template->render( // WPCS: XSS OK.
			'options/email-address.php',
			compact( 'placeholder', 'value' )
		);
	}
1086145
def add_email_addresses(self, addresses=[]):
        
        json = []
        if addresses:
            url = self._build_url('user', 'emails')
            json = self._json(self._post(url, data=addresses), 201)
        return json
1280093
def add_private_note(self, private_notes, source=None):
        
        self._append_to('_private_notes', self._sourced_dict(
            source,
            value=private_notes,
        ))
352999
def getaddresses(fieldvalues):
    """"""
    all = COMMASPACE.join(fieldvalues)
    a = _AddressList(all)
    return a.addresslist
459057
def createEmails(nicks=None, nicksFile=None):
    
    candidate_emails = set()
    if nicks != None:
        for n in nicks:
            for e in email_providers.domains:
                candidate_emails.add("{}@{}".format(n, e))
    elif nicksFile != None:
        with open(nicksFile, "r") as iF:
            nicks = iF.read().splitlines()
            for n in nicks:
                for e in email_providers.domains:
                    candidate_emails.add("{}@{}".format(n, e))
    return candidate_emails
543536
def formatted
      list = element.addresses.map { |a| a.format }
      Mail::AddressContainer.new(self, list)
    end
599259
def add_note(self, body):
        
        from highton.models.note import Note
        created_id = self._post_request(
            endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Note.ENDPOINT,
            data=self.element_to_string(
                Note(body=body).encode()
            )
        ).headers.get('Location').replace('.xml', '').split('/')[-1]
        return Note.get(created_id)