Skip to content

Commit

Permalink
Fixed issue #10222: Attachments for registration emails don't get att…
Browse files Browse the repository at this point in the history
…ached
  • Loading branch information
c-schmitz committed Apr 13, 2016
1 parent 0979c88 commit b2aaf0f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion application/controllers/RegisterController.php
Expand Up @@ -260,6 +260,27 @@ public function sendRegistrationEmail($iSurveyId,$iTokenId){
$sFrom = $event->get('from');
$sBounce = $event->get('bounce');

$aRelevantAttachments = array();
if (isset($aSurveyInfo['attachments']))
{
$aAttachments = unserialize($aSurveyInfo['attachments']);
if (!empty($aAttachments))
{
if (isset($aAttachments['registration']))
{
LimeExpressionManager::singleton()->loadTokenInformation($aSurveyInfo['sid'], $emrow['token']);

foreach ($aAttachments['registration'] as $aAttachment)
{
if (LimeExpressionManager::singleton()->ProcessRelevance($aAttachment['relevance']))
{
$aRelevantAttachments[] = $aAttachment['url'];
}
}
}
}
}

if ($event->get('send', true) == false)
{
$this->sMessage=$event->get('message', $this->sMailMessage); // event can send is own message
Expand All @@ -270,7 +291,7 @@ public function sendRegistrationEmail($iSurveyId,$iTokenId){
$oToken->save();
}
}
elseif (SendEmailMessage($aMail['message'], $aMail['subject'], $sTo, $sFrom, $sitename,$useHtmlEmail,$sBounce))
elseif (SendEmailMessage($aMail['message'], $aMail['subject'], $sTo, $sFrom, $sitename,$useHtmlEmail,$sBounce,$aRelevantAttachments))
{
// TLR change to put date into sent
$today = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig('timeadjust'));
Expand Down

0 comments on commit b2aaf0f

Please sign in to comment.