CodeDownload
if (isnum(isset($_REQUEST['id'])) AND isset($_REQUEST['activate'])) {
echo "<div style='text-align:center'>\n";
$get_vc = dbquery("SELECT * FROM ".DB_NEWS_LETTER_SUBS." WHERE nl_sub_id='".$_REQUEST['id']."'");
$get_vca = dbarray($get_vc);
$get_vcr = dbrows($get_vc);
if ($get_vcr != 0) {
if ($get_vca['nl_sub_stat'] == 0) {
$get_vn = dbquery("SELECT * FROM ".DB_NEWS_LETTER_VALIDATE." WHERE validate_code='".$_REQUEST['activate']."'");
$get_vna = dbarray($get_vn);
$get_vnr = dbrows($get_vn);
if ($get_vnr != 0) {
$result = dbquery("UPDATE ".DB_NEWS_LETTER_SUBS." SET nl_sub_stat='1' WHERE nl_sub_id ='".$_REQUEST['id']."'");
$result = dbquery("DELETE FROM ".DB_NEWS_LETTER_VALIDATE." WHERE validate_code='".$_REQUEST['activate']."'");
// send pm to site admin
$pm_send = dbquery("SELECT nl_sub_id, nl_sub_mail, nl_sub_name, nl_sub_stat FROM ".DB_NEWS_LETTER_SUBS." WHERE nl_sub_stat='1' AND nl_sub_id='".$_REQUEST['id']."'");
if (dbrows($pm_send) != 0) {
require_once INCLUDES."infusions_include.php";
while($data = dbarray($pm_send)) {
$sendr = $data['nl_sub_mail'];
$pnam = $data['nl_sub_name'];
$recvr = 1;
$sndit = ($locale['nl_498']."".$pnam.$locale['nl_499']);
send_pm($recvr, $sendr, $locale['nl_497'], $sndit);
}
}
// end pm send
I have tried the $recvr variable as ($settings['siteemail'] and also just "webmaster@whisperwillow.com") . I realize that code taken out of context can be hard to interpret/follow and I will post the entire script if needed. Right after the code: if (dbrows($pm_send) !=0) if I do this: echo dbrows($pm_send); exit; .. it stops the script and prints a 1 to the screen so I know it's doing the dbquery and getting a result. Any help would be appreciated very much. I am using Fusion 7.02.07
Merged on 05/28/2018:
OK ! I figured out why it won't work ! The '$sendr' variable which gets input to 'infusions_include.php' as the '$from' variable, is a public user who has an email address but NO system user id. I don't know how to fix that except maybe using one of my alternate logins as the sender. That should work.