Skip to content

Commit

Permalink
Fixed Feature: custom Email ignores the maxemail setting for now.
Browse files Browse the repository at this point in the history
dev: No solution how to count those mails in order to resume later.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey181@6583 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Tim Wahrendorff committed Mar 24, 2009
1 parent 6d83353 commit 423be3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 79 deletions.
62 changes: 8 additions & 54 deletions admin/remotecontrol/lsrc.helper.php
Expand Up @@ -103,7 +103,7 @@ function changeTable($table, $key, $value, $where, $mode='0')//XXX

}

/*
/*
* Function to send Emails to participants of a specific survey
*/
function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX
Expand All @@ -115,7 +115,7 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX
include("../../classes/core/html_entity_decode_php4.php");
$lsrcHelper= new LsrcHelper();

// wenn maxmails ber den lsrc gegeben wird das nurtzen, ansonsten die default werte aus der config.php
// wenn maxmails ber den lsrc gegeben wird das nutzen, ansonsten die default werte aus der config.php
if($maxLsrcEmails!='')
$maxemails = $maxLsrcEmails;

Expand Down Expand Up @@ -388,8 +388,7 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX
$_POST['message_'.$languageRow['surveyls_language']] = $languageRow['surveyls_email_remind'];
$_POST['subject_'.$languageRow['surveyls_language']] = $languageRow['surveyls_email_remind_subj'];
}



//$tokenoutput .= $clang->gT("Sending Reminders")."<br />\n";

$surveylangs = GetAdditionalLanguagesFromSurveyID($surveyid);
Expand All @@ -403,18 +402,8 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX

}

// if (isset($starttokenid)) {$tokenoutput .= " (".$clang->gT("From Token ID").":&nbsp;{$starttokenid})";}
// if (isset($tokenid)) {$tokenoutput .= " (".$clang->gT("Sending to Token ID").":&nbsp;{$tokenid})";}

// if (isset($_POST['bypassbademails']) && $_POST['bypassbademails'] == 'Y')
// {
$SQLemailstatuscondition = " AND emailstatus = 'OK'";
// }
// else
// {
// $SQLemailstatuscondition = "";
// }

$SQLemailstatuscondition = " AND emailstatus = 'OK'";

if (isset($_POST['maxremindercount']) &&
$_POST['maxremindercount'] != '' &&
intval($_POST['maxremindercount']) != 0)
Expand Down Expand Up @@ -466,11 +455,6 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX
$emresult = db_select_limit_assoc($emquery, $maxemails);
//$emresult = db_execute_assoc($emquery);
$emcount = $emresult->RecordCount();
// $tokenoutput .= "<table width='500' align='center' >\n"
// ."\t<tr>\n"
// ."\t\t<td><font size='1'>\n";



if ($emcount > 0)
{
Expand Down Expand Up @@ -561,43 +545,13 @@ function emailSender($surveyid, $type, $maxLsrcEmails='') //XXX
if ($ctcount > $emcount)
{
$lefttosend = $ctcount-$maxemails;
// $tokenoutput .= "\t\t</td>\n"
// ."\t</tr>\n"
// ."\t<tr><form method='post' action='$scriptname?action=tokens&amp;sid=$surveyid'>"
// ."\t\t<td align='center'>\n"
// ."\t\t\t<strong>".$clang->gT("Warning")."</strong><br /><br />\n"
// .$clang->gT("There are more emails pending than can be sent in one batch. Continue sending emails by clicking below.")."<br /><br />\n"
// .str_replace("{EMAILCOUNT}", $lefttosend, $clang->gT("There are {EMAILCOUNT} emails still to be sent."))
// ."<br />\n"
// ."\t\t\t<input type='submit' value='".$clang->gT("Continue")."' />\n"
// ."\t\t</td>\n"
// ."\t<input type='hidden' name='ok' value=\"absolutely\" />\n"
// ."\t<input type='hidden' name='subaction' value=\"remind\" />\n"
// ."\t<input type='hidden' name='action' value=\"tokens\" />\n"
// ."\t<input type='hidden' name='sid' value=\"{$surveyid}\" />\n";
// foreach ($surveylangs as $language)
// {
// $message = html_escape($_POST['message_'.$language]);
//// $tokenoutput .="\t\t\t<input type='hidden' name='from_$language' value=\"".$_POST['from_'.$language]."\" />\n"
//// ."\t\t\t<input type='hidden' name='subject_$language' value=\"".$_POST['subject_'.$language]."\" />\n"
//// ."\t\t\t<input type='hidden' name='message_$language' value=\"$message\" />\n";
// }
// $tokenoutput.="\t<input type='hidden' name='last_tid' value=\"$lasttid\" />\n"
// ."\t</form>\n";
}else{$lefttosend = 0;}
}
// else
// {
//// $tokenoutput .= "<center><strong>".$clang->gT("Warning")."</strong><br />\n"
//// .$clang->gT("There were no eligible emails to send. This will be because none satisfied the criteria of - having an email address, having been sent an invitation, but not having yet completed the survey.")."\n"
//// ."<br /><br />\n"
//// ."\t\t</td>\n";
// }

if($emcount==0)
else
{
return "No Reminders to send";
}
}

if($maxemails>0)
{
$returnValue = "".$mailsSend." Reminders send. ".$lefttosend." Reminders left to send";
Expand Down
30 changes: 5 additions & 25 deletions admin/remotecontrol/lsrc.server.php
Expand Up @@ -143,7 +143,8 @@ function sSendEmail($sUser, $sPass, $iVid, $type, $maxLsrcEmails='', $subject=''

if (isset($tokenid)) {$emquery .= " and tid='{$tokenid}'";}
$tokenoutput .= "\n\n<!-- emquery: $emquery -->\n\n";
$emresult = db_select_limit_assoc($emquery,$maxemails);
//$emresult = db_select_limit_assoc($emquery,$maxemails);
$emresult = db_execute_assoc($emquery);
$emcount = $emresult->RecordCount();

if ($emcount > 0)
Expand All @@ -159,10 +160,10 @@ function sSendEmail($sUser, $sPass, $iVid, $type, $maxLsrcEmails='', $subject=''
{
//$tokenoutput .= ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) failed. Error Message:")." ".$maildebug."<br />", $fieldsarray);
if($n==1)
$failedAddresses .= ",".$to;
$failedAddresses .= ",".$emrow['email'];
else
{
$failedAddresses = $to;
$failedAddresses = $emrow['email'];
$n=1;
}

Expand Down Expand Up @@ -202,28 +203,7 @@ function sSendEmail($sUser, $sPass, $iVid, $type, $maxLsrcEmails='', $subject=''
$emailSenderReturn = $lsrcHelper->emailSender($iVid, $type, $maxLsrcEmails);

return $emailSenderReturn;
// if($maxemails != '')
// {
// return $emailSenderReturn;
// if($emailSenderReturn)
// {
// return "Mails send successfully";
// }
// else
// return $emailSenderReturn;
// }
// else
// {
// if($emailSenderReturn)
// {
// return "Mails send successfully";
// }
// else
// {
// throw new SoapFault("Sending Mail: ", "".$emailSenderReturn);
// exit;
// }
// }

}
else
{
Expand Down

0 comments on commit 423be3e

Please sign in to comment.