IF YOU ARE USING v1.3.0.0, or v1.3.0.1, the following may be of benefit.
Versions v1.3.0.2 and higher have this ALREADY built-in.
A few code changes will help you send a test newsletter to the email address of your current Admin account:
1. via phpMyAdmin or Install SQL Patches, run the following SQL statement:
Code:
INSERT INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( NULL, 'email,newsletters', 'Administrator', 'Just the email account of the current administrator', 'select \'ADMIN\' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from TABLE_ADMIN where admin_id = $SESSION:admin_id');
2. edit /includes/functions/audience.php. Around line 99 you find the following block:
PHP Code:
function parsed_query_string($read_string) {
// extract table names from sql strings, so that prefixes are supported.
// this will also in the future be used to reconstruct queries from query_keys_list field in query_builder table.
$allwords = explode( " ", $read_string );
reset( $allwords );
while( list( $key, $val ) = each( $allwords ) ) {
// find "{TABLE_" and extract that tablename
if( substr( $val, 0, 7) == "{TABLE_" && substr( $val, -1) == "}" ) { //check for leading and trailing {} braces
$val = substr( $val, 2, strlen($val)-2); // strip off braces. Could also use str_replace(array('{','}'),'',$val);
//now return the value of the CONSTANT with the name that $val has. ie: TABLE_CUSTOMERS = zen_customers
$val = constant($val);
} elseif ( substr( $val, 0, 6) == "TABLE_" ) {
//return the value of the CONSTANT with the name that $val has. ie: TABLE_CUSTOMERS = zen_customers
$val = constant($val);
}
$good_string .= $val.' ';
}
return $good_string;
}
replace that with this:
PHP Code:
function parsed_query_string($read_string) {
// extract table names from sql strings, so that prefixes are supported.
// this will also in the future be used to reconstruct queries from query_keys_list field in query_builder table.
$allwords = explode( " ", $read_string );
reset( $allwords );
while( list( $key, $val ) = each( $allwords ) ) {
// find "{TABLE_" and extract that tablename
if( substr( $val, 0, 7) == "{TABLE_" && substr( $val, -1) == "}" ) { //check for leading and trailing {} braces
$val = substr( $val, 2, strlen($val)-2); // strip off braces. Could also use str_replace(array('{','}'),'',$val);
//now return the value of the CONSTANT with the name that $val has. ie: TABLE_CUSTOMERS = zen_customers
$val = constant($val);
} elseif ( substr( $val, 0, 6) == "TABLE_" ) {
//return the value of the CONSTANT with the name that $val has. ie: TABLE_CUSTOMERS = zen_customers
$val = constant($val);
} elseif ( substr( $val, 0, 9) == '$SESSION:' ) {
//return the value of the SESSION var indicated
$param = str_replace('$SESSION:', '', $val);
$val = $_SESSION[$param];
}
$good_string .= $val.' ';
}
return $good_string;
}
Bookmarks