From 7103382fec45c597e2d0458ca3356417b795654a Mon Sep 17 00:00:00 2001 From: Sarah Poger Gladstone Date: Sat, 2 Apr 2016 13:15:00 -0400 Subject: [PATCH] Update fancytokens.php --- fancytokens.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fancytokens.php b/fancytokens.php index f44d407..5925259 100644 --- a/fancytokens.php +++ b/fancytokens.php @@ -162,10 +162,15 @@ function fancytokens_civicrm_tokens( &$tokens ){ } function fancytokens_civicrm_tokenValues( &$values, &$contactIDs, $job = null, $tokens = array(), $context = null) { - + + + if(!empty($tokens['communitynews'])){ - $website_host_name = $_SERVER['SERVER_NAME']; + + $civi_url = CRM_Utils_System::url('civicrm/example', NULL, TRUE, NULL, FALSE); + $website_host_name = parse_url( $civi_url, PHP_URL_HOST ); + $ssl_in_use = $_SERVER['HTTPS']; if( strlen($ssl_in_use) > 0){ $protocol = "https://";