Skip to content

Commit

Permalink
New feature #09904 : allow to use EXPIRY in expression when sending e…
Browse files Browse the repository at this point in the history
…mail

Dev: Think SURVEYNAME/ADMINNAM etc ...  don't have to be used
Dev: maybe adding it when have same function for GUI and for RC
  • Loading branch information
Shnoulle committed Dec 9, 2015
1 parent 7e3b798 commit e30ac92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion application/controllers/admin/tokens.php
Expand Up @@ -1418,7 +1418,8 @@ function email($iSurveyId, $tokenids = null)
->createAbsoluteUrl("/optin/tokens",array("surveyid"=>$iSurveyId,"langcode"=>trim($emrow['language']),"token"=>$emrow['token']));
$fieldsarray["{SURVEYURL}"] = $this->getController()
->createAbsoluteUrl("/survey/index",array("sid"=>$iSurveyId,"token"=>$emrow['token'],"lang"=>trim($emrow['language'])));

// Add some var for expression : actually only EXPIRY because : it's used in limereplacement field and have good reason to have it.
$fieldsarray["{EXPIRY}"]=$aData['thissurvey']["expires"];
$customheaders = array('1' => "X-surveyid: " . $iSurveyId,
'2' => "X-tokenid: " . $fieldsarray["{TOKEN}"]);
global $maildebug;
Expand Down
1 change: 1 addition & 0 deletions application/helpers/admin/token_helper.php
Expand Up @@ -78,6 +78,7 @@ function emailTokens($iSurveyID,$aResultTokens,$sType)

$fieldsarray["{ADMINNAME}"] = $oSurvey->admin;
$fieldsarray["{ADMINEMAIL}"] = $oSurvey->adminemail;
$fieldsarray["{EXPIRY}"]=$oSurvey->expires;
if(empty($fieldsarray["{ADMINEMAIL}"] ))
$fieldsarray["{ADMINEMAIL}"] = Yii::app()->getConfig('siteadminemail');
$from = $fieldsarray["{ADMINNAME}"] . ' <' . $fieldsarray["{ADMINEMAIL}"] . '>';
Expand Down

0 comments on commit e30ac92

Please sign in to comment.