Skip to content

Commit

Permalink
New feature: @@OPTOUTURL@@ & @@OPTINURL@@ placeholders for invitation…
Browse files Browse the repository at this point in the history
…/reminder emails
  • Loading branch information
c-schmitz committed Dec 11, 2017
1 parent d0ce70e commit 2f018f2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions application/helpers/admin/token_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ function emailTokens($iSurveyID,$aResultTokens,$sType)
{
$url = $fieldsarray["{{$key}URL}"];
$fieldsarray["{{$key}URL}"] = "<a href='{$url}'>" . htmlspecialchars($url) . '</a>';
if ($key == 'SURVEY')
{
$barebone_link = $url;
}
$aBareboneURLs['@@'.$key.'URL@@']=$fieldsarray["{{$key}URL}"];
}
}

Expand Down Expand Up @@ -137,10 +134,9 @@ function emailTokens($iSurveyID,$aResultTokens,$sType)
$modsubject = $sSubject;
$modmessage = $sMessage;

if (isset($barebone_link))
{
$modsubject = str_replace("@@SURVEYURL@@", $barebone_link, $modsubject);
$modmessage = str_replace("@@SURVEYURL@@", $barebone_link, $modmessage);
foreach ($aBareboneURLs as $sSearch=>$sReplace) {
$modsubject = str_replace($sSearch, $sReplace, $modsubject);
$modmessage = str_replace($sSearch, $sReplace, $modmessage);
}

$modsubject = ReplaceFields($modsubject, $fieldsarray);
Expand Down

2 comments on commit 2f018f2

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dson't already have it ???? 😮

@maziminke
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reminds me of https://bugs.limesurvey.org/view.php?id=9629
Shouldn't be too hard to add? Any volunteers? Beers on me!

Please sign in to comment.