I'm trying to modify this function to send the result of a query. This function creates the message of an email.
Here is the part the class function i need to modify:
Code: Select all
function send($newsletter_id) {
global $db;
$audience_select = get_audience_sql_query($this->query_name, 'newsletters');
$audience = $db->Execute($audience_select['query_string']);
$records = $audience->RecordCount();
if ($records==0) return 0;
$i=0;
while (!$audience->EOF) {
$i++;
$html_msg['EMAIL_FIRST_NAME'] = $audience->fields['customers_firstname'];
$html_msg['EMAIL_LAST_NAME'] = $audience->fields['customers_lastname'];
$html_msg['EMAIL_MESSAGE_HTML'] = $this->content_html;
}So i have this little scrpt here that modifies the info for another page on the site:
Code: Select all
<?
$result = mysql_query("SELECT * FROM newsletters WHERE newsletters_id ='" . ($_GET['ID']) . "'");
echo "<table width=\"100%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#00FF00\">";
while($r=mysql_fetch_array($result))
{
$items = explode(", ", $r['content_html']);
$num = count($items);
$row++;
for ($c=0; $c < $num; $c++)
{echo "<tr><td>".$items[$c]."</td></tr>";}
}
echo "</table>";
?>So what i'm looking at is having the result of this script equate to the "$this->content_html;" part of the function.
I've been trying to figure this out for a few days and it's really frustrating.
Please help
Thanks
DD