Esempio n. 1
0
 /**
  * Generate a Mautic redirect/passthrough URL
  *
  * @param Redirect $redirect
  * @param array    $clickthrough
  * @param bool     $shortenUrl
  *
  * @return string
  */
 public function generateRedirectUrl(Redirect $redirect, $clickthrough = array(), $shortenUrl = false)
 {
     $url = $this->buildUrl('mautic_url_redirect', array('redirectId' => $redirect->getRedirectId()), true, $clickthrough, $shortenUrl);
     if ($shortenUrl) {
         $url = $this->urlHelper->buildShortUrl($url);
     }
     return $url;
 }
Esempio n. 2
0
 /**
  * @param string $email
  * @param string $size
  * @param string $default
  *
  * @return string
  */
 public function getImage($email, $size = '250', $default = null)
 {
     $localDefault = $this->devMode ? 'https://www.mautic.org/media/images/default_avatar.png' : $this->avatarHelper->getDefaultAvatar(true);
     $url = 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $size;
     if ($default === null) {
         $default = $localDefault;
     }
     $default = strpos($default, '.') !== false && strpos($default, 'http') !== 0 ? UrlHelper::rel2abs($default) : $default;
     $url .= '&d=' . urlencode($default);
     return $url;
 }
Esempio n. 3
0
 /**
  * @param string $email
  * @param string $size
  * @param string $default
  *
  * @return string
  */
 public function getImage($email, $size = '250', $default = null)
 {
     $localDefault = $this->devMode || in_array($this->request->getClientIp(), array_merge($this->devHosts, ['127.0.0.1', 'fe80::1', '::1'])) ? 'https://www.mautic.org/media/images/default_avatar.png' : $this->avatarHelper->getDefaultAvatar(true);
     $url = 'https://www.gravatar.com/avatar/' . md5(strtolower(trim($email))) . '?s=' . $size;
     if ($default === null) {
         $default = $localDefault;
     }
     $default = strpos($default, '.') !== false && strpos($default, 'http') !== 0 ? UrlHelper::rel2abs($default) : $default;
     $url .= '&d=' . urlencode($default);
     return $url;
 }