Get a Gravatar Avatar URL
@param  string $email Gravatar Email address
@return string        Gravatar Avatar URL
@throws \InvalidArgumentException If $email is invalid
777854
public function avatar($email) {
		if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
			$baseUrl = $this->useHttps ? $this->https($this->baseUrl) : $this->baseUrl;
			$url = $baseUrl . "avatar/" . $this->generateHash($email);
		} else {
			throw new InvalidArgumentException("The avatar filter must be passed a valid Email address");
		}

		if ($this->rating) {
			$url = $this->rating($url, $this->rating);
		}

		if ($this->size) {
			$url = $this->size($url, $this->size);
		}

		if ($this->default) {
			$url = $this->def($url, $this->default);
		}

		return $url;
	}
360696
public function get_gravatar($email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array())
    {
        return self::getGravatar($email, $s, $d, $r, $img, $atts);
    }
609011
public function getAutoregisterModel($email)
    {
        if(!$this->isRegistrationEnabled()) {
            return null;
        }

        $ret = User::USER_AUTOREGISTER; // default if there is no whitelist defined at all

        // try to match against the whitelist
        if( ($xml = $this->get_sxml_structure()) !== false) {
            $wl = $xml->xpath('/record/registration/auto_register/email_whitelist');
            if($wl !== false && count($wl) === 1) {
                $ret = null;    // there IS a whitelist, the email must match

                foreach ($wl[0]->xpath('email') as $element) {
                    if (preg_match($element['pattern'], $email) === 1) {
                        return (string)$element['user_model'];
                    }
                }
            }
        }

        return $ret;
    }
1111998
protected static function validateEmailAddress($email) {
		if (empty($email)) {
			throw new InvalidEmailException();
		}

		$email = \trim($email);

		if (!\filter_var($email, \FILTER_VALIDATE_EMAIL)) {
			throw new InvalidEmailException();
		}

		return $email;
	}
605941
public static function stripEmail($email) {
		if (strpos($email, '<') && substr($email, -1) == '>') {
			return substr($email, strpos($email, '<') + 1, (strlen($email) - strpos($email, '<')) - 2);
		}
		return $email;
	}
82698
public static function parseEmailAddress($email)
    {
        $pattern = sprintf('/^(?<local>%s)@(?<domain>%s)$/iD', self::EMAIL_REGEX_LOCAL, self::EMAIL_REGEX_DOMAIN);

        if (!preg_match($pattern, $email, $parts)) {
            throw new InvalidEmailException(sprintf('"%s" is not a valid email', $email));
        }

        return array_map('strtolower', [$parts['local'], $parts['domain']]);
    }
1017134
public function profile(string $email, ?bool $secure = null): string
    {
        return $this->buildUrl($this->createEmailHash($email), $secure);
    }
1367601
public String getGravatar() {
        if (getEmail() == null) {
            return "http://www.gravatar.com/avatar/00000000000000000000000000000000";
        } else {
            final MD5 md5 = new MD5();
            final String hash = md5.calcMD5(getEmail());
            return "http://www.gravatar.com/avatar/" + hash;
        }
    }
754881
public function getUrl( $email ){
		$hash	= md5( strtolower( trim( $email ) ) );
		$query	= array(
			's'	=> $this->size,
			'd'	=> $this->default,
			'r'	=> $this->rate,
		);
		return $this->url.$hash.'?'.http_build_query( $query, NULL, '&amp;' );
	}
143707
protected function embedImages($email) {

        $html_embed = $email['body'];

        foreach ($email['attachments'] as $key => $attachment) {
            if (strtolower($attachment['disposition']) == 'inline' && !empty($attachment['reference'])){
                $file = $this->getAttachment($email['id'] , $key);

                $reference = str_replace(array("<", ">"), "", $attachment['reference']);
                $img_embed = "data:image/" . strtolower($file['type']) . ";base64," . base64_encode($file['content']);

                $html_embed = str_replace("cid:" . $reference, $img_embed, $html_embed);
            }
        }
        return $html_embed;
    }
1306478
public function image($email, $size = null, array $attributes = array(), $secure = true)
    {
        return '<img src="'.$this->url($email, $size, $secure).'"'.$this->attributes($attributes).'>';
    }
354682
public static function email($email)
    {
        $email = Str::trim($email);
        $cleaned = filter_var($email, FILTER_VALIDATE_EMAIL);

        if (Email::isValid($cleaned)) {
            return $cleaned;
        }

        return false;
    }
1075656
public function getProfileUrl($email, $format = 'json', array $options = [])
    {
        $url = 'https://www.gravatar.com/';

        $url .= md5(strtolower(trim($email))).'.';
        $url .= in_array($format, ['json', 'xml', 'php', 'vcf', 'qr']) ? $format : 'json';

        if ($options) {
            $url .= '?'.http_build_query($options);
        }

        return $url;
    }
505976
public function renderImage( $email, $attributes = array() ){
		$attributes['src']		= $this->getUrl( $email );
		$attributes['width']	= $this->size;
		$attributes['height']	= $this->size;
		return UI_HTML_Tag::create( 'img', NULL, $attributes );
	}
245169
public static function email($email)
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }
460842
public function getUri()
    {
        if (empty($this->getConfig('email')) === true) {
            throw new \RuntimeException('No email specified.');
        }
        $uri = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($this->getConfig('email')))) . '.jpg';
        $args = http_build_query([
            's' => $this->getConfig('size'),
            'd' => $this->getConfig('defaultUri'),
        ]);
        if (empty($args) === false) {
            $uri .= '?' . $args;
        }
        return $uri;
    }
1070983
public function render() {
        $sanitizedEmail = strtolower(trim((string)$this->arguments['email']));
        $gravatarUri = 'https://www.gravatar.com/avatar/' . md5($sanitizedEmail);
        $uriParts = array();
        if ($this->arguments['default']) {
            $uriParts[] = 'd=' . urlencode($this->arguments['default']);
        }
        if ($this->arguments['size']) {
            $uriParts[] = 's=' . $this->arguments['size'];
            if (!isset($this->arguments['width']) && !isset($this->arguments['height'])) {
                $this->tag->addAttribute('width', $this->arguments['size']);
                $this->tag->addAttribute('height', $this->arguments['size']);
            }
        }
        if (!isset($this->arguments['alt'])) {
            $this->tag->addAttribute('alt', 'Gravatar');
        }
        if (count($uriParts)) {
            $gravatarUri .= '?' . implode('&', $uriParts);
        }
        $this->tag->addAttribute('src', $gravatarUri);
        return $this->tag->render();
    }