Sensei
- Join Date:
- Jan 2004
- Posts:
- 63,511
- Plugin Contributions:
- 176
v1.3.0 / v1.3.0.1 How to send test newsletter to self
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:
- via phpMyAdmin or Install SQL Patches, run the following SQL statement:```
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
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
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;
}
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.