本文整理汇总了PHP中BxDolEmailTemplates::parseTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolEmailTemplates::parseTemplate方法的具体用法?PHP BxDolEmailTemplates::parseTemplate怎么用?PHP BxDolEmailTemplates::parseTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BxDolEmailTemplates
的用法示例。
在下文中一共展示了BxDolEmailTemplates::parseTemplate方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProfileInfo
function _checkProfileMatch($iProfileId, $sAction)
{
$aProfile = getProfileInfo($iProfileId);
if ($aProfile['Status'] == 'Active' && ($aProfile['UpdateMatch'] || $sAction == 'join')) {
$oDb = new BxDolDb();
// clear field "UpdateMatch"
$oDb->query("UPDATE `Profiles` SET `UpdateMatch` = 0 WHERE `ID`= {$iProfileId}");
// clear cache
$oDb->query("DELETE FROM `sys_profiles_match`");
// get send mails
$aSendMails = $oDb->getRow("SELECT `profiles_match` FROM `sys_profiles_match_mails` WHERE `profile_id` = {$iProfileId}");
$aSend = !empty($aSendMails) ? unserialize($aSendMails['profiles_match']) : array();
$aProfiles = getMatchProfiles($iProfileId);
foreach ($aProfiles as $iProfId) {
if (!isset($aSend[(int) $iProfId])) {
$oEmailTemplate = new BxDolEmailTemplates();
$aMessage = $oEmailTemplate->parseTemplate('t_CupidMail', array('StrID' => $iProfId, 'MatchProfileLink' => getProfileLink($iProfileId)), $iProfId);
$aProfile = getProfileInfo($iProfId);
if (!empty($aProfile) && $aProfile['Status'] == 'Active') {
$oDb->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aProfile['Email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "', '" . process_db_input($aMessage['body'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "')");
}
$aSend[(int) $iProfId] = 0;
}
}
if (empty($aSendMails)) {
$oDb->query("INSERT INTO `sys_profiles_match_mails`(`profile_id`, `profiles_match`) VALUES({$iProfileId}, '" . serialize($aSend) . "')");
} else {
$oDb->query("UPDATE `sys_profiles_match_mails` SET `profiles_match` = '" . serialize($aSend) . "' WHERE `profile_id` = {$iProfileId}");
}
}
}
示例2: sendUnregisterUserNotify
function sendUnregisterUserNotify($aMember)
{
if (empty($aMember) || !is_array($aMember)) {
return false;
}
$oEmailTemplates = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplates->parseTemplate('t_UserUnregistered', array('NickName' => $aMember['NickName'], 'Email' => $aMember['Email']));
return sendMail($GLOBALS['site']['email'], $aTemplate['subject'], $aTemplate['body']);
}
示例3: PreviewMessage
function PreviewMessage()
{
$oEmailTemplate = new BxDolEmailTemplates();
$aMessage = $oEmailTemplate->parseTemplate('t_AdminEmail', array('MessageText' => process_pass_data($_POST['body'])));
return DesignBoxContent(_t('_Preview'), $aMessage['body'], 11);
}
示例4: bx_admin_profile_change_status
/**
* Perform change of status with clearing profile(s) cache and sending mail about activation
*
* @param mixed $mixedIds - array of IDs or single int ID of profile(s)
* @param string $sStatus - given status
* @param boolean $bSendActMail - send email about activation or not (works with 'Active' status only
* @return boolean - TRUE on success / FALSE on failure
*/
function bx_admin_profile_change_status($mixedIds, $sStatus, $bSendActMail = FALSE)
{
if (!$mixedIds || is_array($mixedIds) && empty($mixedIds)) {
return FALSE;
}
if (!is_array($mixedIds)) {
$mixedIds = array((int) $mixedIds);
}
$sStatus = strip_tags($sStatus);
$oEmailTemplate = new BxDolEmailTemplates();
foreach ($mixedIds as $iId) {
$iId = (int) $iId;
if (!$GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status` = '{$sStatus}' WHERE `ID` = {$iId}")) {
break;
}
createUserDataFile($iId);
reparseObjTags('profile', $iId);
if ($sStatus == 'Active' && $bSendActMail) {
if (BxDolModule::getInstance('BxWmapModule')) {
BxDolService::call('wmap', 'response_entry_add', array('profiles', $iId));
}
$aProfile = getProfileInfo($iId);
$aMail = $oEmailTemplate->parseTemplate('t_Activation', array(), $iId);
sendMail($aProfile['Email'], $aMail['subject'], $aMail['body'], $iId, array(), 'html', FALSE, TRUE);
}
$oAlert = new BxDolAlerts('profile', 'change_status', $iId, 0, array('status' => $sStatus));
$oAlert->alert();
}
return TRUE;
}
示例5: setMembership
//.........这里部分代码省略.........
*
* @param int $days - number of days to set membership for
* if 0, then the membership is set forever
*
* @param boolean $bStartsNow - if true, the membership will start immediately;
* if false, the membership will start after the current
* membership expires
*
* @return boolean - true in case of success, false in case of failure
*
*
*/
function setMembership($iMemberId, $iMembershipId, $iDays = 0, $bStartsNow = false, $sTransactionId = '', $isSendMail = true)
{
$iMemberId = (int) $iMemberId;
$iMembershipId = (int) $iMembershipId;
$iDays = (int) $iDays;
$bStartsNow = $bStartsNow ? true : false;
$SECONDS_IN_DAY = 86400;
if (!$iMemberId) {
$iMemberId = -1;
}
if (empty($sTransactionId)) {
$sTransactionId = 'NULL';
}
//check if member exists
$aProfileInfo = getProfileInfo($iMemberId);
if (!$aProfileInfo) {
return false;
}
//check if membership exists
$iRes = (int) db_value("SELECT COUNT(`ID`) FROM `sys_acl_levels` WHERE `ID`='" . $iMembershipId . "' LIMIT 1");
if ($iRes != 1) {
return false;
}
if ($iMembershipId == MEMBERSHIP_ID_NON_MEMBER) {
return false;
}
$aMembershipCurrent = getMemberMembershipInfo($iMemberId);
$aMembershipLatest = getMemberMembershipInfo_latest($iMemberId);
/**
* Setting Standard membership level
*/
if ($iMembershipId == MEMBERSHIP_ID_STANDARD) {
if ($aMembershipCurrent['ID'] == MEMBERSHIP_ID_STANDARD) {
return true;
}
//delete any present and future memberships
$res = db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember`='" . $iMemberId . "' AND (`DateExpires` IS NULL OR `DateExpires`>NOW())");
if (db_affected_rows($res) <= 0) {
return false;
}
}
if ($iDays < 0) {
return false;
}
$iDateStarts = time();
if (!$bStartsNow) {
/**
* make the membership starts after the latest membership expires
* or return false if latest membership isn't Standard and is lifetime membership
*/
if (!is_null($aMembershipLatest['DateExpires'])) {
$iDateStarts = $aMembershipLatest['DateExpires'];
} else {
if (is_null($aMembershipLatest['DateExpires']) && $aMembershipLatest['ID'] != MEMBERSHIP_ID_STANDARD) {
return false;
}
}
} else {
// delete previous profile's membership level and actions traces
db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember`='" . $iMemberId . "'");
clearActionsTracksForMember($iMemberId);
}
/**
* set lifetime membership if 0 days is used.
*/
$iDateExpires = $iDays != 0 ? (int) $iDateStarts + $iDays * $SECONDS_IN_DAY : 'NULL';
$res = db_res("INSERT `sys_acl_levels_members` (`IDMember`, `IDLevel`, `DateStarts`, `DateExpires`, `TransactionID`) VALUES ('" . $iMemberId . "', '" . $iMembershipId . "', FROM_UNIXTIME(" . $iDateStarts . "), FROM_UNIXTIME(" . $iDateExpires . "), '" . $sTransactionId . "')");
if (db_affected_rows($res) <= 0) {
return false;
}
//Set Membership Alert
bx_import('BxDolAlerts');
$oZ = new BxDolAlerts('profile', 'set_membership', '', $iMemberId, array('mlevel' => $iMembershipId, 'days' => $iDays, 'starts_now' => $bStartsNow, 'txn_id' => $sTransactionId));
$oZ->alert();
//Notify user about changed membership level
bx_import('BxDolEmailTemplates');
$oEmailTemplate = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplate->getTemplate('t_MemChanged', $iMemberId);
$aMembershipInfo = getMembershipInfo($iMembershipId);
$aTemplateVars = array('MembershipLevel' => $aMembershipInfo['Name']);
if ($isSendMail) {
sendMail($aProfileInfo['Email'], $aTemplate['Subject'], $aTemplate['Body'], $iMemberId, $aTemplateVars);
}
//Notify admin about changed user's membership level
$aTemplate = $oEmailTemplate->parseTemplate('t_UserMemChanged', $aTemplateVars, $iMemberId);
sendMail($GLOBALS['site']['email'], $aTemplate['Subject'], $aTemplate['Body']);
return true;
}
示例6: performJoin
/**
*
* Join Methods
*
*/
function performJoin($iPendingId, $aPayment = array())
{
$oSession = BxDolSession::getInstance();
$oSession->setValue($this->_sSessionKeyPending, (int) $iPendingId);
if (!empty($aPayment['payer_name']) && !empty($aPayment['payer_email'])) {
bx_import('BxDolEmailTemplates');
$oEmailTemplates = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplates->parseTemplate($this->_sEmailTemplatesPrefix . 'paid_need_join', array('RealName' => $aPayment['payer_name'], 'JoinLink' => bx_append_url_params($this->_oConfig->getJoinUrl(), array($this->_sRequestKeyPending => (int) $iPendingId))));
sendMail($aPayment['payer_email'], $aTemplate['Subject'], $aTemplate['Body'], 0, array(), 'html', false, true);
}
header('Location: ' . $this->_oConfig->getJoinUrl());
exit;
}
示例7: sendDelivery
function sendDelivery($aParams)
{
$iQueued = 0;
$oEmailTemplates = new BxDolEmailTemplates();
$aSubscription = $this->getSubscription($aParams['unit'], $aParams['action']);
if (!empty($aSubscription['params'])) {
$oFunction = create_function('$arg1, $arg2, $arg3', $aSubscription['params']);
$aUnitParams = $oFunction($aParams['unit'], $aParams['action'], $aParams['object_id']);
}
if (isset($aUnitParams['skip']) && $aUnitParams['skip'] === true) {
return $iQueued;
}
$aSubscribers = $this->getAll("SELECT `id` AS `subscription_id`, `subscriber_id` AS `id`, `subscriber_type` AS `type` FROM `" . $this->_sPrefix . "entries` WHERE `subscription_id`='" . (empty($aSubscription['id']) ? 0 : $aSubscription['id']) . "'" . ((int) $aParams['object_id'] != 0 ? " AND `object_id`='" . $aParams['object_id'] . "'" : ""));
foreach ($aSubscribers as $aSubscriber) {
switch ($aSubscriber['type']) {
case BX_DOL_SBS_TYPE_VISITOR:
$sSql = "SELECT '0' AS `id`, `name`, `email` FROM `" . $this->_sPrefix . "users` WHERE `id`='" . $aSubscriber['id'] . "' LIMIT 1";
break;
case BX_DOL_SBS_TYPE_MEMBER:
$sSql = "SELECT `ID` AS `id`, `NickName` AS `name`, `Email` AS `email` FROM `Profiles` WHERE `ID`='" . $aSubscriber['id'] . "' LIMIT 1";
break;
}
$aUser = $this->getRow($sSql);
//--- Parse message ---//
$sSql = "SELECT\n `tse`.`id` AS `id`\n FROM `" . $this->_sPrefix . "entries` AS `tse`\n LEFT JOIN `" . $this->_sPrefix . "types` AS `tst` ON `tse`.`subscription_id`=`tst`.`id` AND `tst`.`unit`='" . $aParams['unit'] . "' AND `tst`.`action`<>''\n WHERE `tse`.`subscriber_id`='" . $aSubscriber['id'] . "' AND `tse`.`subscriber_type`='" . $aSubscriber['type'] . "'" . ((int) $aParams['object_id'] != 0 ? " AND `object_id`='" . $aParams['object_id'] . "'" : "");
$aEntries = $this->getColumn($sSql);
$aTemplateParams = array('RealName' => $aUser['id'] ? getNickName($aUser['id']) : $aUser['name'], 'Email' => $aUser['email'], 'ObjectId' => $aParams['object_id'], 'UnsubscribeLink' => $this->_oSubscription->_getUnsubscribeLink((int) $aSubscriber['subscription_id']), 'UnsubscribeAllLink' => $this->_oSubscription->_getUnsubscribeLink($aEntries));
if (isset($aUnitParams['template'])) {
$aTemplateParams = array_merge($aTemplateParams, $aUnitParams['template']);
}
$aMail = $oEmailTemplates->parseTemplate($aSubscription['template'], $aTemplateParams, (int) $aUser['id']);
$iQueued += (int) $this->query("INSERT INTO `" . $this->_sPrefix . "queue`(`email`, `subject`, `body`) VALUES('" . $aUser['email'] . "', '" . process_db_input($aMail['subject'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "', '" . process_db_input($aMail['body'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "')");
}
return $iQueued;
}
示例8: actionFinalizeCheckout
function actionFinalizeCheckout($sProvider, $mixedVendorId = "")
{
$aData =& $_REQUEST;
$aProvider = is_numeric($mixedVendorId) && (int) $mixedVendorId != BX_PMT_EMPTY_ID ? $this->_oDb->getVendorInfoProviders((int) $mixedVendorId, $sProvider) : $this->_oDb->getProviders($sProvider);
$sClassPath = !empty($aProvider['class_file']) ? BX_DIRECTORY_PATH_ROOT . $aProvider['class_file'] : $this->_oConfig->getClassPath() . $aProvider['class_name'] . '.php';
if (empty($aProvider) || !file_exists($sClassPath)) {
$this->_onResultPage(array('message' => _t($this->_sLangsPrefix . 'err_incorrect_provider')));
exit;
}
require_once $sClassPath;
$oProvider = new $aProvider['class_name']($this->_oDb, $this->_oConfig, $aProvider);
$aResult = $oProvider->finalizeCheckout($aData);
if ((int) $aResult['code'] == 1) {
$aPending = $this->_oDb->getPending(array('type' => 'id', 'id' => (int) $aResult['pending_id']));
//--- Check "Pay Before Join" situation
if ((int) $aPending['client_id'] == 0) {
$oSession = BxDolSession::getInstance();
$oSession->setValue($this->_sSessionKeyPending, (int) $aPending['id']);
if (!empty($aResult['payer_name']) && !empty($aResult['payer_email'])) {
bx_import('BxDolEmailTemplates');
$oEmailTemplates = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplates->parseTemplate($this->_sEmailTemplatesPrefix . 'paid_need_join', array('RealName' => $aResult['payer_name'], 'JoinLink' => bx_append_url_params(BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'join', array($this->_sRequestKeyPending => (int) $aPending['id']))));
sendMail($aResult['payer_email'], $aTemplate['Subject'], $aTemplate['Body'], 0, array(), 'html', false, true);
}
header('Location: ' . $this->_oConfig->getJoinUrl());
exit;
}
//--- Register payment for purchased items in associated modules
$this->_oCart->updateInfo($aPending);
if ($oProvider->needRedirect()) {
header('Location: ' . $this->_oConfig->getReturnUrl());
exit;
}
}
$this->_onResultPage($aResult);
exit;
}
示例9: isset
define('BX_DOL_ADM_MP_JS_NAME', 'oMP');
define('BX_DOL_ADM_MP_PER_PAGE', 50);
define('BX_DOL_ADM_MP_PER_PAGE_STEP', 16);
$logged['admin'] = member_auth(1, true, true);
$sCtlType = isset($_POST['adm-mp-members-ctl-type']) && in_array($_POST['adm-mp-members-ctl-type'], array('qlinks', 'browse', 'calendar', 'tags', 'search')) ? $_POST['adm-mp-members-ctl-type'] : BX_DOL_ADM_MP_CTL;
$aCtlType = array();
$sViewType = isset($_POST['adm-mp-members-view-type']) && in_array($_POST['adm-mp-members-view-type'], array('geeky', 'simple', 'extended')) ? $_POST['adm-mp-members-view-type'] : BX_DOL_ADM_MP_VIEW;
//--- Process Actions ---//
if (isset($_POST['adm-mp-activate']) && (bool) $_POST['members']) {
$GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status`='Active' WHERE `ID` IN ('" . implode("','", $_POST['members']) . "')");
$oEmailTemplate = new BxDolEmailTemplates();
foreach ($_POST['members'] as $iId) {
createUserDataFile((int) $iId);
reparseObjTags('profile', (int) $iId);
$aProfile = getProfileInfo($iId);
$aMail = $oEmailTemplate->parseTemplate('t_Activation', array(), $iId);
sendMail($aProfile['Email'], $aMail['subject'], $aMail['body'], $iId, array(), 'html', false, true);
$oAlert = new BxDolAlerts('profile', 'change_status', (int) $iId, 0, array('status' => 'Active'));
$oAlert->alert();
}
echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>";
exit;
} else {
if (isset($_POST['adm-mp-deactivate']) && (bool) $_POST['members']) {
$GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status`='Approval' WHERE `ID` IN ('" . implode("','", $_POST['members']) . "')");
foreach ($_POST['members'] as $iId) {
createUserDataFile((int) $iId);
reparseObjTags('profile', (int) $iId);
$oAlert = new BxDolAlerts('profile', 'change_status', (int) $iId, 0, array('status' => 'Approval'));
$oAlert->alert();
}
示例10: PreviewMessage
function PreviewMessage()
{
$oEmailTemplate = new BxDolEmailTemplates();
$aMessage = $oEmailTemplate->parseTemplate('t_AdminEmail', array('MessageText' => process_pass_data($_POST['body'])));
$sPreview = '<div style="margin:9px;">' . $aMessage['body'] . '</div>';
return DesignBoxContent(_t('_Preview'), $sPreview, 1);
}
示例11: processAdminStats
function processAdminStats()
{
$iCounter = 0;
$sMessage = "";
$aStats = getSiteStatArray();
foreach ($aStats as $sName => $aStat) {
if (empty($aStat['adm_query'])) {
continue;
}
$iNumber = (int) $GLOBALS['MySQL']->getOne($aStat['adm_query']);
if ($iNumber <= 0) {
continue;
}
$sMessage .= '<p>' . $iNumber . ' ' . _t('_' . $aStat['capt'] . '_adm_stats') . ',</p>';
}
$aAdmins = $GLOBALS['MySQL']->getAll("SELECT * FROM `Profiles` WHERE `Role`&" . BX_DOL_ROLE_ADMIN . "<>0 AND `EmailNotify`='1'");
if (!empty($sMessage) && !empty($aAdmins)) {
$oEmailTemplate = new BxDolEmailTemplates();
$aEmailParams = array('MessageText' => $sMessage, 'ViewLink' => BX_DOL_URL_ADMIN);
foreach ($aAdmins as $aAdmin) {
$aMail = $oEmailTemplate->parseTemplate('t_AdminStats', $aEmailParams, $aAdmin['ID']);
if (sendMail($aAdmin['Email'], $aMail['subject'], $aMail['body'], $aAdmin['ID'], array(), 'html', false, true)) {
$iCounter++;
}
}
}
return $iCounter;
}