• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getBounceEmail函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getBounceEmail函数的典型用法代码示例。如果您正苦于以下问题:PHP getBounceEmail函数的具体用法?PHP getBounceEmail怎么用?PHP getBounceEmail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getBounceEmail函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: array

                }

                $msgsubject=Replacefields($_POST['subject_'.$emrow['language']], $fieldsarray);
                $sendmessage=Replacefields($_POST['message_'.$emrow['language']], $fieldsarray);
$customheaders = array( '1' => "X-surveyid: ".$surveyid,
                    '2' => "X-tokenid: ".$fieldsarray["{TOKEN}"]);

                if (trim($emrow['validfrom'])!='' && convertDateTimeFormat($emrow['validfrom'],'Y-m-d H:i:s','U')*1>date('U')*1)
                {
                    $tokenoutput .= $emrow['tid'] ." ".ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) delayed: Token is not yet valid.")."<br />", $fieldsarray);
                }
                elseif (trim($emrow['validuntil'])!='' && convertDateTimeFormat($emrow['validuntil'],'Y-m-d H:i:s','U')*1<date('U')*1)
                {
                    $tokenoutput .= $emrow['tid'] ." ".ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) skipped: Token is not valid anymore.")."<br />", $fieldsarray);
                }
                elseif (SendEmailMessage($sendmessage, $msgsubject, $to, $from, $sitename,$ishtml,getBounceEmail($surveyid),null,$customheaders))
                {

                    // Put date into remindersent
                    $today = date_shift(date("Y-m-d H:i:s"), "Y-m-d H:i", $timeadjust);
                    $udequery = "UPDATE ".db_table_name("tokens_{$surveyid}")."\n"
                    ."SET remindersent='$today',remindercount = remindercount+1  WHERE tid={$emrow['tid']}";
                    //
                    $uderesult = $connect->Execute($udequery) or safe_die ("Could not update tokens<br />$udequery<br />".$connect->ErrorMsg());
                    //orig: $tokenoutput .= "({$emrow['tid']})[".$clang->gT("Reminder sent to:")." {$emrow['firstname']} {$emrow['lastname']}]<br />\n";
                    $tokenoutput .= "({$emrow['tid']}) [".$clang->gT("Reminder sent to:")." {$emrow['firstname']} {$emrow['lastname']} ($to)]<br />\n";
                }
                else
                {
                    $tokenoutput .= $emrow['tid'] ." ".ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) failed. Error Message:")." ".$maildebug."<br />", $fieldsarray);
                    if ($debug>0)
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:31,代码来源:tokens.php


示例2: submitfailed

/**
* submitfailed : used in em_manager_helper.php
*/
function submitfailed($errormsg = '')
{
    global $debug;
    global $thissurvey;
    global $subquery, $surveyid;
    $clang = Yii::app()->lang;
    $completed = "<br /><strong><font size='2' color='red'>" . $clang->gT("Did Not Save") . "</strong></font><br /><br />\n\n" . $clang->gT("An unexpected error has occurred and your responses cannot be saved.") . "<br /><br />\n";
    if ($thissurvey['adminemail']) {
        $completed .= $clang->gT("Your responses have not been lost and have been emailed to the survey administrator and will be entered into our database at a later point.") . "<br /><br />\n";
        if ($debug > 0) {
            $completed .= 'Error message: ' . htmlspecialchars($errormsg) . '<br />';
        }
        $email = $clang->gT("An error occurred saving a response to survey id", "unescaped") . " " . $thissurvey['name'] . " - {$surveyid}\n\n";
        $email .= $clang->gT("DATA TO BE ENTERED", "unescaped") . ":\n";
        foreach ($_SESSION['survey_' . $surveyid]['insertarray'] as $value) {
            $email .= "{$value}: {$_SESSION['survey_' . $surveyid][$value]}\n";
        }
        $email .= "\n" . $clang->gT("SQL CODE THAT FAILED", "unescaped") . ":\n" . "{$subquery}\n\n" . $clang->gT("ERROR MESSAGE", "unescaped") . ":\n" . $errormsg . "\n\n";
        SendEmailMessage($email, $clang->gT("Error saving results", "unescaped"), $thissurvey['adminemail'], $thissurvey['adminemail'], "LimeSurvey", false, getBounceEmail($surveyid));
        //echo "<!-- EMAIL CONTENTS:\n$email -->\n";
        //An email has been sent, so we can kill off this session.
        killSurveySession($surveyid);
    } else {
        $completed .= "<a href='javascript:location.reload()'>" . $clang->gT("Try to submit again") . "</a><br /><br />\n";
        $completed .= $subquery;
    }
    return $completed;
}
开发者ID:elcharlygraf,项目名称:Encuesta-YiiFramework,代码行数:31,代码来源:frontend_helper.php


示例3: link

             }
             if ($saver['email']) {
                 //Send email
                 if (validate_email($saver['email']) && !returnglobal('redo')) {
                     $subject = $clang->gT("Saved Survey Details");
                     $message = $clang->gT("Thank you for saving your survey in progress.  The following details can be used to return to this survey and continue where you left off.  Please keep this e-mail for your reference - we cannot retrieve the password for you.");
                     $message .= "\n\n" . $thissurvey['name'] . "\n\n";
                     $message .= $clang->gT("Name") . ": " . $saver['identifier'] . "\n";
                     $message .= $clang->gT("Password") . ": " . $saver['password'] . "\n\n";
                     $message .= $clang->gT("Reload your survey by clicking on the following link (or pasting it into your browser):") . "\n";
                     $message .= $publicurl . "/index.php?sid={$surveyid}&loadall=reload&scid=" . $scid . "&lang=" . urlencode($saver['language']) . "&loadname=" . urlencode($saver['identifier']) . "&loadpass=" . urlencode($saver['password']);
                     if (isset($tokendata['token'])) {
                         $message .= "&token=" . $tokendata['token'];
                     }
                     $from = $thissurvey['adminemail'];
                     if (SendEmailMessage(null, $message, $subject, $saver['email'], $from, $sitename, false, getBounceEmail($surveyid))) {
                         $emailsent = "Y";
                         $dataentryoutput .= "<font class='successtitle'>" . $clang->gT("An email has been sent with details about your saved survey") . "</font><br />\n";
                     }
                 }
             }
         } else {
             safe_die("Unable to insert record into saved_control table.<br /><br />" . $connect->ErrorMsg());
         }
     }
     $dataentryoutput .= "\t<div class='successheader'>" . $clang->gT("Success") . "</div>\n";
     $thisid = $connect->Insert_ID();
     $dataentryoutput .= "\t" . $clang->gT("The entry was assigned the following record id: ") . " {$thisid}<br /><br />\n";
 }
 $dataentryoutput .= $errormsg;
 $dataentryoutput .= "\t<input type='submit' value='" . $clang->gT("Add Another Record") . "' onclick=\"window.open('{$scriptname}?action=dataentry&amp;sid={$surveyid}&amp;language=" . $_POST['language'] . "', '_top')\" /><br /><br />\n";
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:dataentry.php


示例4: sSendEmail

/**
 *
 * Function to send reminder, invitation or custom mails to participants of a specific survey
 * @param $sUser
 * @param $sPass
 * @param $iVid
 * @param $type
 * @param $maxLsrcEmails
 * @param $subject
 * @param $emailText
 * @return unknown_type
 */
function sSendEmail($sUser, $sPass, $iVid, $type, $maxLsrcEmails = '', $subject = '', $emailText = '')
{
    global $sitename, $siteadminemail;
    include "lsrc.config.php";
    $lsrcHelper = new lsrcHelper();
    $lsrcHelper->debugLsrc("wir sind in " . __FUNCTION__ . " Line " . __LINE__ . ", START OK ");
    // wenn maxmails ber den lsrc gegeben wird das nurtzen, ansonsten die default werte aus der config.php
    if ($maxLsrcEmails != '') {
        $maxemails = $maxLsrcEmails;
    }
    if (!$lsrcHelper->checkUser($sUser, $sPass)) {
        throw new SoapFault("Authentication: ", "User or password wrong");
        exit;
    }
    // Check if all mandatory parameters are present, else abort...
    if (!is_int($iVid) || $iVid == 0 || $type == '') {
        throw new SoapFault("Server: ", "Mandatory Parameters missing");
        exit;
    }
    if ($type == 'custom' && $subject != '' && $emailText != '') {
        //GET SURVEY DETAILS not working here... don't know why...
        //$thissurvey=getSurveyInfo($iVid);
        $from = $siteadminemail;
        $lsrcHelper->debugLsrc("wir sind in " . __FUNCTION__ . " Line " . __LINE__ . ", Admin Email: {$from} ; survey: {$iVid}  ; dump: " . print_r($thissurvey) . "");
        $emquery = "SELECT firstname, lastname, email, token, tid, language";
        //if ($ctfieldcount > 7) {$emquery .= ", attribute_1, attribute_2";}
        $emquery .= " FROM " . db_table_name("tokens_{$iVid}") . " WHERE email != '' ";
        if (isset($tokenid)) {
            $emquery .= " and tid='{$tokenid}'";
        }
        $tokenoutput .= "\n\n<!-- emquery: {$emquery} -->\n\n";
        //$emresult = db_select_limit_assoc($emquery,$maxemails);
        $emresult = db_execute_assoc($emquery);
        $emcount = $emresult->RecordCount();
        if ($emcount > 0) {
            $mailsSend = 0;
            while ($emrow = $emresult->FetchRow()) {
                if (SendEmailMessage($emailText, $subject, $emrow['email'], $from, $sitename, $ishtml = false, getBounceEmail($iVid))) {
                    $mailsSend++;
                } else {
                    //$tokenoutput .= ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) failed. Error Message:")." ".$maildebug."<br />", $fieldsarray);
                    if ($n == 1) {
                        $failedAddresses .= "," . $emrow['email'];
                    } else {
                        $failedAddresses = $emrow['email'];
                        $n = 1;
                    }
                }
            }
        } else {
            return "No Mails to send";
        }
        //		if ($ctcount > $emcount)
        //		{
        //			$lefttosend = $ctcount-$maxemails;
        //
        //		}else{$lefttosend = 0;}
        //		if($maxemails>0)
        //		{
        //			$returnValue = "".$mailsSend." Mails send. ".$lefttosend." Mails left to send";
        //			if(isset($failedAddresses))
        //				$returnValue .= "\nCould not send to: ".$failedAddresses;
        //			return $returnValue;
        //		}
        if (isset($mailsSend)) {
            $returnValue = "" . $mailsSend . " Mails send. ";
            if (isset($failedAddresses)) {
                $returnValue .= "\nCould not send to: " . $failedAddresses;
            }
            return $returnValue;
        }
    }
    if ($type == 'invite' || $type == 'remind') {
        $emailSenderReturn = $lsrcHelper->emailSender($iVid, $type, $maxLsrcEmails);
        return $emailSenderReturn;
    } else {
        throw new SoapFault("Type: ", "Wrong send Type given. Possible types are: custom, invite or remind");
        exit;
    }
}
开发者ID:himanshu12k,项目名称:ce-www,代码行数:92,代码来源:lsrc.server.php


示例5: emailTokens


//.........这里部分代码省略.........
    array_unshift($aSurveyLangs, $oSurvey->language);
    //Convert result to associative array to minimize SurveyLocale access attempts
    foreach ($oSurveyLocale as $rows) {
        $oTempObject = array();
        foreach ($rows as $k => $v) {
            $oTempObject[$k] = $v;
        }
        $aSurveyLocaleData[$rows['surveyls_language']] = $oTempObject;
    }
    foreach ($aResultTokens as $aTokenRow) {
        //Select language
        $aTokenRow['language'] = trim($aTokenRow['language']);
        $found = array_search($aTokenRow['language'], $aSurveyLangs);
        if ($aTokenRow['language'] == '' || $found == false) {
            $aTokenRow['language'] = $oSurvey['language'];
        }
        $sTokenLanguage = $aTokenRow['language'];
        //Build recipient
        $to = array();
        $aEmailaddresses = explode(';', $aTokenRow['email']);
        foreach ($aEmailaddresses as $sEmailaddress) {
            $to[] = $aTokenRow['firstname'] . " " . $aTokenRow['lastname'] . " <{$sEmailaddress}>";
        }
        //Populate attributes
        $fieldsarray["{SURVEYNAME}"] = $aSurveyLocaleData[$sTokenLanguage]['surveyls_title'];
        if ($fieldsarray["{SURVEYNAME}"] == '') {
            $fieldsarray["{SURVEYNAME}"] = $aSurveyLocaleData[$oSurvey['language']]['surveyls_title'];
        }
        $fieldsarray["{SURVEYDESCRIPTION}"] = $aSurveyLocaleData[$sTokenLanguage]['surveyls_description'];
        if ($fieldsarray["{SURVEYDESCRIPTION}"] == '') {
            $fieldsarray["{SURVEYDESCRIPTION}"] = $aSurveyLocaleData[$oSurvey['language']]['surveyls_description'];
        }
        $fieldsarray["{ADMINNAME}"] = $oSurvey['admin'];
        $fieldsarray["{ADMINEMAIL}"] = $oSurvey['adminemail'];
        $from = $fieldsarray["{ADMINNAME}"] . ' <' . $fieldsarray["{ADMINEMAIL}"] . '>';
        if ($from == '') {
            $from = Yii::app()->getConfig('siteadminemail');
        }
        foreach ($attributes as $attributefield) {
            $fieldsarray['{' . strtoupper($attributefield) . '}'] = $aTokenRow[$attributefield];
            $fieldsarray['{TOKEN:' . strtoupper($attributefield) . '}'] = $aTokenRow[$attributefield];
        }
        //create urls
        $fieldsarray["{OPTOUTURL}"] = Yii::app()->getController()->createAbsoluteUrl("/optout/tokens/langcode/" . trim($aTokenRow['language']) . "/surveyid/{$iSurveyID}/token/{$aTokenRow['token']}");
        $fieldsarray["{OPTINURL}"] = Yii::app()->getController()->createAbsoluteUrl("/optin/tokens/langcode/" . trim($aTokenRow['language']) . "/surveyid/{$iSurveyID}/token/{$aTokenRow['token']}");
        $fieldsarray["{SURVEYURL}"] = Yii::app()->getController()->createAbsoluteUrl("/survey/index/sid/{$iSurveyID}/token/{$aTokenRow['token']}/lang/" . trim($aTokenRow['language']) . "/");
        if ($bHtml) {
            foreach (array('OPTOUT', 'OPTIN', 'SURVEY') as $key) {
                $url = $fieldsarray["{{$key}URL}"];
                $fieldsarray["{{$key}URL}"] = "<a href='{$url}'>" . htmlspecialchars($url) . '</a>';
                if ($key == 'SURVEY') {
                    $barebone_link = $url;
                }
            }
        }
        //mail headers
        $customheaders = array('1' => "X-surveyid: " . $iSurveyID, '2' => "X-tokenid: " . $fieldsarray["{TOKEN}"]);
        global $maildebug;
        //choose appriopriate email message
        if ($sType == 'invite') {
            $sSubject = $aSurveyLocaleData[$sTokenLanguage]['surveyls_email_invite_subj'];
            $sMessage = $aSurveyLocaleData[$sTokenLanguage]['surveyls_email_invite'];
        } else {
            if ($sType == 'register') {
                $sSubject = $aSurveyLocaleData[$sTokenLanguage]['surveyls_email_register_subj'];
                $sMessage = $aSurveyLocaleData[$sTokenLanguage]['surveyls_email_register'];
            } else {
                $sSubject = $aSurveyLocaleData[$sTokenLanguage]['surveyls_email_remind_subj'];
                $sMessage = $aSurveyLocaleData[$sTokenLanguage]['surveyls_email_remind'];
            }
        }
        $modsubject = Replacefields($sSubject, $fieldsarray);
        $modmessage = Replacefields($sMessage, $fieldsarray);
        if (isset($barebone_link)) {
            $modsubject = str_replace("@@SURVEYURL@@", $barebone_link, $modsubject);
            $modmessage = str_replace("@@SURVEYURL@@", $barebone_link, $modmessage);
        }
        if (isset($aTokenRow['validfrom']) && trim($aTokenRow['validfrom']) != '' && convertDateTimeFormat($aTokenRow['validfrom'], 'Y-m-d H:i:s', 'U') * 1 > date('U') * 1) {
            $aResult[$aTokenRow['tid']] = array('name' => $fieldsarray["{FIRSTNAME}"] . " " . $fieldsarray["{LASTNAME}"], 'email' => $fieldsarray["{EMAIL}"], 'status' => 'fail', 'error' => 'Token not valid yet');
        } elseif (isset($aTokenRow['validuntil']) && trim($aTokenRow['validuntil']) != '' && convertDateTimeFormat($aTokenRow['validuntil'], 'Y-m-d H:i:s', 'U') * 1 < date('U') * 1) {
            $aResult[$aTokenRow['tid']] = array('name' => $fieldsarray["{FIRSTNAME}"] . " " . $fieldsarray["{LASTNAME}"], 'email' => $fieldsarray["{EMAIL}"], 'status' => 'fail', 'error' => 'Token not valid anymore');
        } else {
            if (SendEmailMessage($modmessage, $modsubject, $to, $from, Yii::app()->getConfig("sitename"), $bHtml, getBounceEmail($iSurveyID), null, $customheaders)) {
                $aResult[$aTokenRow['tid']] = array('name' => $fieldsarray["{FIRSTNAME}"] . " " . $fieldsarray["{LASTNAME}"], 'email' => $fieldsarray["{EMAIL}"], 'status' => 'OK');
                if ($sType == 'invite' || $sType == 'register') {
                    $oTokens->updateByPk($aTokenRow['tid'], array('sent' => dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"))));
                }
                if ($sType == 'remind') {
                    $iRCount = $oTokens->findByPk($aTokenRow['tid'])->remindercount + 1;
                    $oTokens->updateByPk($aTokenRow['tid'], array('remindersent' => dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"))));
                    $oTokens->updateByPk($aTokenRow['tid'], array('remindercount' => $iRCount));
                }
            } else {
                $aResult[$aTokenRow['tid']] = array('name' => $fieldsarray["{FIRSTNAME}"] . " " . $fieldsarray["{LASTNAME}"], 'email' => $fieldsarray["{EMAIL}"], 'status' => 'fail', 'error' => $maildebug);
            }
        }
        unset($fieldsarray);
    }
    return $aResult;
}
开发者ID:withhope,项目名称:HIT-Survey,代码行数:101,代码来源:token_helper.php


示例6: actionIndex


//.........这里部分代码省略.........
     // Get the survey settings for token length
     $tokenlength = $thissurvey['tokenlength'];
     //if tokenlength is not set or there are other problems use the default value (15)
     if (!isset($tokenlength) || $tokenlength == '') {
         $tokenlength = 15;
     }
     while ($mayinsert != true) {
         $newtoken = randomChars($tokenlength);
         $oTokenExist = TokenDynamic::model($iSurveyID)->find('token=:token', array(':token' => $newtoken));
         if (!$oTokenExist) {
             $mayinsert = true;
         }
     }
     $postfirstname = sanitize_xss_string(strip_tags(Yii::app()->request->getPost('register_firstname')));
     $postlastname = sanitize_xss_string(strip_tags(Yii::app()->request->getPost('register_lastname')));
     $starttime = sanitize_xss_string(Yii::app()->request->getPost('startdate'));
     $endtime = sanitize_xss_string(Yii::app()->request->getPost('enddate'));
     /*$postattribute1=sanitize_xss_string(strip_tags(returnGlobal('register_attribute1')));
       $postattribute2=sanitize_xss_string(strip_tags(returnGlobal('register_attribute2')));   */
     // Insert new entry into tokens db
     $oToken = Token::create($thissurvey['sid']);
     $oToken->firstname = $postfirstname;
     $oToken->lastname = $postlastname;
     $oToken->email = Yii::app()->request->getPost('register_email');
     $oToken->emailstatus = 'OK';
     $oToken->token = $newtoken;
     if ($starttime && $endtime) {
         $oToken->validfrom = $starttime;
         $oToken->validuntil = $endtime;
     }
     $oToken->setAttributes($attributeinsertdata, false);
     $result = $oToken->save();
     //$tid = $oToken->tid;// Not needed any more
     $fieldsarray["{ADMINNAME}"] = $thissurvey['adminname'];
     $fieldsarray["{ADMINEMAIL}"] = $thissurvey['adminemail'];
     $fieldsarray["{SURVEYNAME}"] = $thissurvey['name'];
     $fieldsarray["{SURVEYDESCRIPTION}"] = $thissurvey['description'];
     $fieldsarray["{FIRSTNAME}"] = $postfirstname;
     $fieldsarray["{LASTNAME}"] = $postlastname;
     $fieldsarray["{EXPIRY}"] = $thissurvey["expiry"];
     $fieldsarray["{TOKEN}"] = $oToken->token;
     $fieldsarray["{EMAIL}"] = $oToken->email;
     $token = $oToken->token;
     $message = $thissurvey['email_register'];
     $subject = $thissurvey['email_register_subj'];
     $from = "{$thissurvey['adminname']} <{$thissurvey['adminemail']}>";
     $surveylink = $this->createAbsoluteUrl("/survey/index/sid/{$iSurveyID}", array('lang' => $sBaseLanguage, 'token' => $newtoken));
     $optoutlink = $this->createAbsoluteUrl("/optout/tokens/surveyid/{$iSurveyID}", array('langcode' => $sBaseLanguage, 'token' => $newtoken));
     $optinlink = $this->createAbsoluteUrl("/optin/tokens/surveyid/{$iSurveyID}", array('langcode' => $sBaseLanguage, 'token' => $newtoken));
     if (getEmailFormat($iSurveyID) == 'html') {
         $useHtmlEmail = true;
         $fieldsarray["{SURVEYURL}"] = "<a href='{$surveylink}'>" . $surveylink . "</a>";
         $fieldsarray["{OPTOUTURL}"] = "<a href='{$optoutlink}'>" . $optoutlink . "</a>";
         $fieldsarray["{OPTINURL}"] = "<a href='{$optinlink}'>" . $optinlink . "</a>";
     } else {
         $useHtmlEmail = false;
         $fieldsarray["{SURVEYURL}"] = $surveylink;
         $fieldsarray["{OPTOUTURL}"] = $optoutlink;
         $fieldsarray["{OPTINURL}"] = $optinlink;
     }
     $message = ReplaceFields($message, $fieldsarray);
     $subject = ReplaceFields($subject, $fieldsarray);
     $html = "";
     //Set variable
     $sitename = Yii::app()->getConfig('sitename');
     if (SendEmailMessage($message, $subject, Yii::app()->request->getPost('register_email'), $from, $sitename, $useHtmlEmail, getBounceEmail($iSurveyID))) {
         // 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'));
         $oToken->sent = $today;
         $oToken->save();
         $html = "<div id='wrapper' class='message tokenmessage'>" . "<p>" . $clang->gT("Thank you for registering to participate in this survey.") . "</p>\n" . "<p>" . $clang->gT("An email has been sent to the address you provided with access details for this survey. Please follow the link in that email to proceed.") . "</p>\n" . "<p>" . $clang->gT("Survey administrator") . " {ADMINNAME} ({ADMINEMAIL})</p>" . "</div>\n";
         $html = ReplaceFields($html, $fieldsarray);
     } else {
         $html = "Email Error";
     }
     //PRINT COMPLETED PAGE
     if (!$thissurvey['template']) {
         $thistpl = getTemplatePath(validateTemplateDir('default'));
     } else {
         $thistpl = getTemplatePath(validateTemplateDir($thissurvey['template']));
     }
     // Same fix than http://bugs.limesurvey.org/view.php?id=8441
     ob_start(function ($buffer, $phase) {
         App()->getClientScript()->render($buffer);
         App()->getClientScript()->reset();
         return $buffer;
     });
     ob_implicit_flush(false);
     sendCacheHeaders();
     doHeader();
     Yii::app()->lang = $clang;
     // fetch the defined variables and pass it to the header footer templates.
     $redata = compact(array_keys(get_defined_vars()));
     $this->_printTemplateContent($thistpl . '/startpage.pstpl', $redata, __LINE__);
     $this->_printTemplateContent($thistpl . '/survey.pstpl', $redata, __LINE__);
     echo $html;
     $this->_printTemplateContent($thistpl . '/endpage.pstpl', $redata, __LINE__);
     doFooter();
     ob_flush();
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:101,代码来源:RegisterController.php


示例7: submitfailed

/**
 * submitfailed : used in em_manager_helper.php
 *
 * "Unexpected error"
 *
 * Will send e-mail to adminemail if defined.
 *
 * @param string $errormsg
 * @param string $query  Will be included in sent email
 * @return string Error message
 */
function submitfailed($errormsg = '', $query = null)
{
    global $debug;
    global $thissurvey;
    global $subquery, $surveyid;
    $completed = "<p><span class='fa fa-exclamation-triangle'></span>&nbsp;<strong>" . gT("Did Not Save") . "</strong></p>" . "<p>" . gT("An unexpected error has occurred and your responses cannot be saved.") . "</p>";
    if ($thissurvey['adminemail']) {
        $completed .= "<p>";
        $completed .= gT("Your responses have not been lost and have been emailed to the survey administrator and will be entered into our database at a later point.");
        $completed .= "</p>";
        if ($debug > 0) {
            $completed .= 'Error message: ' . htmlspecialchars($errormsg) . '<br />';
        }
        $email = gT("An error occurred saving a response to survey id", "unescaped") . " " . $thissurvey['name'] . " - {$surveyid}\n\n";
        $email .= gT("DATA TO BE ENTERED", "unescaped") . ":\n";
        foreach ($_SESSION['survey_' . $surveyid]['insertarray'] as $value) {
            if (isset($_SESSION['survey_' . $surveyid][$value])) {
                $email .= "{$value}: {$_SESSION['survey_' . $surveyid][$value]}\n";
            } else {
                $email .= "{$value}: N/A\n";
            }
        }
        $email .= "\n" . gT("SQL CODE THAT FAILED", "unescaped") . ":\n" . "{$subquery}\n\n" . ($query ? $query : '') . "\n\n" . gT("ERROR MESSAGE", "unescaped") . ":\n" . $errormsg . "\n\n";
        SendEmailMessage($email, gT("Error saving results", "unescaped"), $thissurvey['adminemail'], $thissurvey['adminemail'], "LimeSurvey", false, getBounceEmail($surveyid));
    } else {
        $completed .= "<a href='javascript:location.reload()'>" . gT("Try to submit again") . "</a><br /><br />\n";
        $completed .= $subquery;
    }
    return $completed;
}
开发者ID:sickpig,项目名称:LimeSurvey,代码行数:41,代码来源:frontend_helper.php


示例8: sendStatistic

 function sendStatistic($surveyid, $to, $tempFile, $html = null)
 {
     include "lsrc.config.php";
     global $sitename;
     global $clang;
     if ($tempFile == null && isset($html)) {
         $css = "<style type='text/css'>" . "table.statisticstable, table.statisticssummary {\r\n\t\t\t\t    background-color:#EEF6FF;\r\n\t\t\t\t    border-collapse:collapse;\r\n\t\t\t\t    border-width: 0px;\r\n\t\t\t\t    border-style: none;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t.statisticssummary thead th\r\n\t\t\t\t{\r\n\t\t\t\t    background:#D2E0F2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t.statisticssummary th:first-child,\r\n\t\t\t\t.statisticstable td:first-child {\r\n\t\t\t\t    text-align:right;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t.statisticssummary thead th:first-child\r\n\t\t\t\t{\r\n\t\t\t\t    text-align:center;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t.statisticssummary th, .statisticssummary td, .statisticstable td {\r\n\t\t\t\t    padding:3px 10px;\r\n\t\t\t\t    \r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t.statisticstable tr {\r\n\t\t\t\t    border-color: #fff;\r\n\t\t\t\t    border-style: solid;\r\n\t\t\t\t    border-width: 1px;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t.statisticstable thead th\r\n\t\t\t\t{\r\n\t\t\t\t    background:#D2E0F2;\r\n\t\t\t\t    text-align:center;\r\n\t\t\t\t    color:#1D2D45;\r\n\t\t\t\t    padding:4 10px;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t.statisticstable tfoot tr {\r\n\t\t\t\t    background:#D2E0F2;\r\n\t\t\t\t    text-align:center;\r\n\t\t\t\t}" . "</style>";
         $message = sprintf($clang->gT("This is your personal statistic sheet for survey #%s"), $css . "<center>" . $message . $surveyid . "<br/>" . $html . "</center>");
         return SendEmailMessage($message, sprintf($clang->gT("Statistics Survey #%s"), $surveyid), $to, getBounceEmail($surveyid), $sitename, true);
     } else {
         $message = sprintf($clang->gT("This is your personal statistic sheet for survey #%s"), $surveyid);
         return SendEmailMessage($message, sprintf($clang->gT("Statistics Survey #%s"), $surveyid), $to, getBounceEmail($surveyid), $sitename, $ishtml, getBounceEmail($surveyid), $tempFile);
     }
 }
开发者ID:rkaldung,项目名称:LimeSurvey,代码行数:14,代码来源:lsrc.helper.php


示例9: savedsilent

/**
 * savesilent() saves survey responses when the "Resume later" button
 * is press but has no interaction. i.e. it does not ask for email,
 * username or password or capture.
 *
 * @return string confirming successful save.
 */
function savedsilent()
{
    global $connect, $surveyid, $dbprefix, $thissurvey, $errormsg, $publicurl, $sitename, $timeadjust, $clang, $clienttoken, $thisstep, $modrewrite;
    submitanswer();
    // Prepare email
    $tokenentryquery = 'SELECT * from '.$dbprefix.'tokens_'.$surveyid.' WHERE token=\''.sanitize_paranoid_string($clienttoken).'\';';
    $tokenentryresult = db_execute_assoc($tokenentryquery);
    $tokenentryarray = $tokenentryresult->FetchRow();

    $from = $thissurvey['adminname'].' <'.$thissurvey['adminemail'].'>';
    $to = $tokenentryarray['firstname'].' '.$tokenentryarray['lastname'].' <'.$tokenentryarray['email'].'>';
    $subject = $clang->gT("Saved Survey Details") . " - " . $thissurvey['name'];
    $message = $clang->gT("Thank you for saving your survey in progress. You can return to the survey at the same point you saved it at any time using the link from this or any previous email sent to regarding this survey.","unescaped")."\n\n";
    $message .= $clang->gT("Reload your survey by clicking on the following link (or pasting it into your browser):","unescaped")."\n";
    $language = $tokenentryarray['language'];

    if($modrewrite)
    {
        $message .= "\n\n$publicurl/$surveyid/lang-$language/tk-$clienttoken";
    }
    else
    {
        $message .= "\n\n$publicurl/index.php?lang=$language&sid=$surveyid&token=$clienttoken";
    };
    if (SendEmailMessage($message, $subject, $to, $from, $sitename, false, getBounceEmail($surveyid)))
    {
        $emailsent="Y";
    }
    else
    {
        echo "Error: Email failed, this may indicate a PHP Mail Setup problem on your server. Your survey details have still been saved, however you will not get an email with the details. You should note the \"name\" and \"password\" you just used for future reference.";
    };
    return  $clang->gT('Your survey was successfully saved.');
};
开发者ID:nmklong,项目名称:limesurvey-cdio3,代码行数:41,代码来源:save.php


示例10: beforeSurveyPage


//.........这里部分代码省略.........
                            $aReplacementFields["{".strtoupper($attribute)."}"]=$value;
                        }
                        $sToken=$oToken->token;
                        $aMail['subject']=preg_replace("/{TOKEN:([A-Z0-9_]+)}/","{"."$1"."}",$aMail['subject']);
                        $aMail['message']=preg_replace("/{TOKEN:([A-Z0-9_]+)}/","{"."$1"."}",$aMail['message']);
                        $surveylink = App()->createAbsoluteUrl("/survey/index/sid/{$iSurveyId}",array('lang'=>$sLanguage,'token'=>$sToken));
                        $optoutlink = App()->createAbsoluteUrl("/optout/tokens/surveyid/{$iSurveyId}",array('langcode'=>$sLanguage,'token'=>$sToken));
                        $optinlink = App()->createAbsoluteUrl("/optin/tokens/surveyid/{$iSurveyId}",array('langcode'=>$sLanguage,'token'=>$sToken));
                        if (getEmailFormat($iSurveyId) == 'html')
                        {
                            $useHtmlEmail = true;
                            $aReplacementFields["{SURVEYURL}"]="<a href='$surveylink'>".$surveylink."</a>";
                            $aReplacementFields["{OPTOUTURL}"]="<a href='$optoutlink'>".$optoutlink."</a>";
                            $aReplacementFields["{OPTINURL}"]="<a href='$optinlink'>".$optinlink."</a>";
                        }
                        else
                        {
                            $useHtmlEmail = false;
                            $aReplacementFields["{SURVEYURL}"]= $surveylink;
                            $aReplacementFields["{OPTOUTURL}"]= $optoutlink;
                            $aReplacementFields["{OPTINURL}"]= $optinlink;
                        }
                        // Allow barebone link for all URL
                        $aMail['message'] = str_replace("@@SURVEYURL@@", $surveylink, $aMail['message']);
                        $aMail['message'] = str_replace("@@OPTOUTURL@@", $optoutlink, $aMail['message']);
                        $aMail['message'] = str_replace("@@OPTINURL@@", $optinlink, $aMail['message']);
                        // Replace the fields
                        $aMail['subject']=ReplaceFields($aMail['subject'], $aReplacementFields);
                        $aMail['message']=ReplaceFields($aMail['message'], $aReplacementFields);
                        
                        // We have it, then try to send the mail.
                        $from = "{$aSurveyInfo['adminname']} <{$aSurveyInfo['adminemail']}>";
                        $sitename =  Yii::app()->getConfig('sitename');
                        if (SendEmailMessage($aMail['message'], $aMail['subject'], $sR_email, $from, $sitename,$useHtmlEmail,getBounceEmail($iSurveyId)))
                        {
                            // 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'));
                            $oToken->sent=$today;
                            $oToken->save();
                            $sReturnHtml="<div id='wrapper' class='message tokenmessage'>"
                                . "<p>".gT("Thank you for registering to participate in this survey.")."</p>\n"
                                . "<p>".$aMail['information']."</p>\n"
                                . "<p>".gT("Survey administrator")." {ADMINNAME} ({ADMINEMAIL})</p>"
                                . "</div>\n";

                        }
                        else
                        {
                            $sReturnHtml="<div id='wrapper' class='message tokenmessage'>"
                                . "<p>".gT("Thank you for registering to participate in this survey.")."</p>\n"
                                . "<p>"."We can not sent you an email actually, please contact the survey administrator"."</p>\n"
                                . "<p>".gT("Survey administrator")." {ADMINNAME} ({ADMINEMAIL})</p>"
                                . "</div>\n";
                        
                        }
                        $sReturnHtml=ReplaceFields($sReturnHtml, $aReplacementFields);
                        $sTemplatePath=$aData['templatedir'] = getTemplatePath($aSurveyInfo['template']);
                        ob_start(function($buffer, $phase) {
                            App()->getClientScript()->render($buffer);
                            App()->getClientScript()->reset();
                            return $buffer;
                        });
                        ob_implicit_flush(false);
                        sendCacheHeaders();
                        doHeader();
                        $aData['thissurvey'] = $aSurveyInfo;
开发者ID:hotcyv,项目名称:LS-replaceRegister,代码行数:67,代码来源:replaceRegister.php


示例11: savedsilent

 /**
  * savesilent() saves survey responses when the "Resume later" button
  * is press but has no interaction. i.e. it does not ask for email,
  * username or password or capture.
  *
  * @return string confirming successful save.
  */
 function savedsilent()
 {
     global $surveyid, $thissurvey, $errormsg, $publicurl, $sitename, $timeadjust, $clang, $clienttoken, $thisstep;
     submitanswer();
     // Prepare email
     $tokenentryquery = 'SELECT * from {{tokens_' . $surveyid . '}} WHERE token=\'' . sanitize_paranoid_string($clienttoken) . '\';';
     $tokenentryresult = dbExecuteAssoc($tokenentryquery);
     $tokenentryarray = $tokenentryresult->read();
     $from = $thissurvey['adminname'] . ' <' . $thissurvey['adminemail'] . '>';
     $to = $tokenentryarray['firstname'] . ' ' . $tokenentryarray['lastname'] . ' <' . $tokenentryarray['email'] . '>';
     $subject = $clang->gT("Saved Survey Details") . " - " . $thissurvey['name'];
     $message = $clang->gT("Thank you for saving your survey in progress. You can return to the survey at the same point you saved it at any time using the link from this or any previous email sent to regarding this survey.") . "\n\n";
     $message .= $clang->gT("Reload your survey by clicking on the following link (or pasting it into your browser):") . ":\n";
     $language = $tokenentryarray['language'];
     //$message .= "\n\n$publicurl/$surveyid/lang-$language/tk-$clienttoken";
     $message .= "\n\n" . Yii::app()->getController()->createAbsoluteUrl("/survey/index/sid/{$surveyid}/lang/{$language}/token/{$clienttoken}");
     if (SendEmailMessage($message, $subject, $to, $from, $sitename, false, getBounceEmail($surveyid))) {
         $emailsent = "Y";
     } else {
         $clang->eT('Error: Email failed, this may indicate a PHP Mail Setup problem on your server. Your survey details have still been saved, however you will not get an email with the details. You should note the "name" and "password" you just used for future reference.');
         if (trim($thissurvey['adminemail']) == '') {
             $clang->eT('(Reason: Admin email address empty)');
         }
     }
     return $clang->gT('Your survey was successfully saved.');
 }
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:33,代码来源:Save.php


示例12: email


//.........这里部分代码省略.........
                 $_POST['message_' . $language] = html_entity_decode(Yii::app()->request->getPost('message_' . $language), ENT_QUOTES, Yii::app()->getConfig("emailcharset"));
             }
         }
         $attributes = getTokenFieldsAndNames($iSurveyId);
         $tokenoutput = "";
         if ($emcount > 0) {
             foreach ($emresult as $emrow) {
                 $to = array();
                 $aEmailaddresses = explode(';', $emrow['email']);
                 foreach ($aEmailaddresses as $sEmailaddress) {
                     $to[] = $emrow['firstname'] . " " . $emrow['lastname'] . " <{$sEmailaddress}>";
                 }
                 $fieldsarray["{EMAIL}"] = $emrow['email'];
                 $fieldsarray["{FIRSTNAME}"] = $emrow['firstname'];
                 $fieldsarray["{LASTNAME}"] = $emrow['lastname'];
                 $fieldsarray["{TOKEN}"] = $emrow['token'];
                 $fieldsarray["{LANGUAGE}"] = $emrow['language'];
                 foreach ($attributes as $attributefield => $attributedescription) {
                     $fieldsarray['{' . strtoupper($attributefield) . '}'] = $emrow[$attributefield];
                     $fieldsarray['{TOKEN:' . strtoupper($attributefield) . '}'] = $emrow[$attributefield];
                 }
                 $emrow['language'] = trim($emrow['language']);
                 $found = array_search($emrow['language'], $aSurveyLangs);
                 if ($emrow['language'] == '' || $found == false) {
                     $emrow['language'] = $sBaseLanguage;
                 }
                 $from = Yii::app()->request->getPost('from_' . $emrow['language']);
                 $fieldsarray["{OPTOUTURL}"] = $this->getController()->createAbsoluteUrl("/optout/tokens/langcode/" . trim($emrow['language']) . "/surveyid/{$iSurveyId}/token/{$emrow['token']}");
                 $fieldsarray["{OPTINURL}"] = $this->getController()->createAbsoluteUrl("/optin/tokens/langcode/" . trim($emrow['language']) . "/surveyid/{$iSurveyId}/token/{$emrow['token']}");
                 $fieldsarray["{SURVEYURL}"] = $this->getController()->createAbsoluteUrl("/survey/index/sid/{$iSurveyId}/token/{$emrow['token']}/langcode/" . trim($emrow['language']) . "/");
                 foreach (array('OPTOUT', 'OPTIN', 'SURVEY') as $key) {
                     $url = $fieldsarray["{{$key}URL}"];
                     if ($bHtml) {
                         $fieldsarray["{{$key}URL}"] = "<a href='{$url}'>" . htmlspecialchars($url) . '</a>';
                     }
                     if ($key == 'SURVEY') {
                         $barebone_link = $url;
                     }
                 }
                 $customheaders = array('1' => "X-surveyid: " . $iSurveyId, '2' => "X-tokenid: " . $fieldsarray["{TOKEN}"]);
                 global $maildebug;
                 $modsubject = Replacefields(Yii::app()->request->getPost('subject_' . $emrow['language']), $fieldsarray);
                 $modmessage = Replacefields(Yii::app()->request->getPost('message_' . $emrow['language']), $fieldsarray);
                 if (isset($barebone_link)) {
                     $modsubject = str_replace("@@SURVEYURL@@", $barebone_link, $modsubject);
                     $modmessage = str_replace("@@SURVEYURL@@", $barebone_link, $modmessage);
                 }
                 if (trim($emrow['validfrom']) != '' && convertDateTimeFormat($emrow['validfrom'], 'Y-m-d H:i:s', 'U') * 1 > date('U') * 1) {
                     $tokenoutput .= $emrow['tid'] . " " . ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) delayed: Token is not yet valid.") . "<br />", $fieldsarray);
                 } elseif (trim($emrow['validuntil']) != '' && convertDateTimeFormat($emrow['validuntil'], 'Y-m-d H:i:s', 'U') * 1 < date('U') * 1) {
                     $tokenoutput .= $emrow['tid'] . " " . ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) skipped: Token is not valid anymore.") . "<br />", $fieldsarray);
                 } else {
                     if (SendEmailMessage($modmessage, $modsubject, $to, $from, Yii::app()->getConfig("sitename"), $bHtml, getBounceEmail($iSurveyId), null, $customheaders)) {
                         // Put date into sent
                         $udequery = Tokens_dynamic::model($iSurveyId)->findByPk($emrow['tid']);
                         if ($bEmail) {
                             $tokenoutput .= $clang->gT("Invitation sent to:");
                             $udequery->sent = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"));
                         } else {
                             $tokenoutput .= $clang->gT("Reminder sent to:");
                             $udequery->remindersent = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"));
                             $udequery->remindercount = $udequery->remindercount + 1;
                         }
                         $udequery->save();
                         //Update central participant survey_links
                         if (!empty($emrow['participant_id'])) {
                             $slquery = Survey_links::model()->find('participant_id = "' . $emrow['participant_id'] . '" AND survey_id = ' . $iSurveyId . ' AND token_id = ' . $emrow['tid']);
                             $slquery->date_invited = dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i", Yii::app()->getConfig("timeadjust"));
                             $slquery->save();
                         }
                         $tokenoutput .= "{$emrow['tid']}: {$emrow['firstname']} {$emrow['lastname']} ({$emrow['email']})<br />\n";
                         if (Yii::app()->getConfig("emailsmtpdebug") == 2) {
                             $tokenoutput .= $maildebug;
                         }
                     } else {
                         $tokenoutput .= ReplaceFields($clang->gT("Email to {FIRSTNAME} {LASTNAME} ({EMAIL}) failed. Error Message:") . " " . $maildebug . "<br />", $fieldsarray);
                     }
                 }
                 unset($fieldsarray);
     

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getBreakdown函数代码示例发布时间:2022-05-15
下一篇:
PHP getBookingExtName函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap