Skip to content

Commit

Permalink
Dev: preparing #10529 quick bugfix
Browse files Browse the repository at this point in the history
Dev: adding $bounce for this plugin, but must have more fix for a better send alternative
Dev: @todo test with a real plugin for $this->sMessage=$event->get('message', $this->sMailMessage);
  • Loading branch information
Shnoulle committed Feb 19, 2016
1 parent a930696 commit dbbcc2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions application/controllers/RegisterController.php
Expand Up @@ -260,10 +260,13 @@ public function sendRegistrationEmail($iSurveyId,$iTokenId){
$aMail['message'] = $event->get('body');
$sTo = $event->get('to');
$sFrom = $event->get('from');
$sBounce = $event->get('bounce');

if ($event->get('send', true) == false)
{
$this->sMessage=$event->get('message', '');
if($event->get('error')==null){// mimic token system, set send to today
$this->sMessage=$event->get('message', $this->sMailMessage); // event can send is own message
if($event->get('error')==null) // mimic core system, set send to today
{
$today = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig('timeadjust'));
$oToken->sent=$today;
$oToken->save();
Expand Down
3 changes: 2 additions & 1 deletion application/controllers/admin/tokens.php
Expand Up @@ -1574,6 +1574,7 @@ function email($iSurveyId, $tokenids = null)
$modmessage = $event->get('body');
$to = $event->get('to');
$from = $event->get('from');
$bounce = $event->get('bounce');
if ($event->get('send', true) == false)
{
// This is some ancient global used for error reporting instead of a return value from the actual mail function..
Expand All @@ -1582,7 +1583,7 @@ function email($iSurveyId, $tokenids = null)
}
else
{
$success = SendEmailMessage($modmessage, $modsubject, $to, $from, Yii::app()->getConfig("sitename"), $bHtml, getBounceEmail($iSurveyId), $aRelevantAttachments, $customheaders);
$success = SendEmailMessage($modmessage, $modsubject, $to, $from, Yii::app()->getConfig("sitename"), $bHtml, $bounce, $aRelevantAttachments, $customheaders);
}

if ($success)
Expand Down

0 comments on commit dbbcc2a

Please sign in to comment.