SMFHacks.com

Newsletter Pro => Support => Topic started by: geminiman on May 01, 2022, 12:00:17 pm

Title: just purchased and uploaded newsletter pro to package manager getting an error
Post by: geminiman on May 01, 2022, 12:00:17 pm
hi i just purchased newsletter pro on the basis that it is advertised as smf 2.1 compatible


   
Newsletter Pro

Information:
Upgrades the built in newsletter functions inside SMF. Adds an updated message editor clicker and opener tracking and more!
Requires
Supports SMF 2.1.x (MySQL), SMF 2.0.x (MySQL), SMF 1.1.x

however upon uploading to package manager when i attempted to install (its not installed yet ) i got an error , here it is

    Execute Modification    ./Sources/ManageNews.php    Test failed

can anyone tell me why i got this test failed error ? , is the mod safe to install ? . thanks in advance for any help .

Title: Re: just purchased and uploaded newsletter pro to package manager getting an error
Post by: SMFHacks on May 01, 2022, 12:06:46 pm
Does it say which one it failed? There should be multiple edits to the file
Title: Re: just purchased and uploaded newsletter pro to package manager getting an error
Post by: SMFHacks on May 01, 2022, 12:14:22 pm
Have a fix download at https://www.smfhacks.com/index.php/topic,2407.msg11756.html#msg11756
Title: Re: just purchased and uploaded newsletter pro to package manager getting an error
Post by: geminiman on May 01, 2022, 12:14:42 pm
hi thanks for your reply . yes there were multiple edit options , 10 in total . the test failed on just one .

find

// Don't sent it twice!
unset($context['recipients']['emails'][$k]);

// Dammit - can't PM emails!
if ($context['send_pm'])
continue;

// Non-members can't subscribe or unsubscribe from anything...
$unsubscribe_link = '';

$to_member = array(
$email,
!empty($_POST['send_html']) ? '<a href="mailto:' . $email . '">' . $email . '</a>' : $email,
'??',
$email,
$unsubscribe_link,
);

sendmail($email, str_replace($from_member, $to_member, $_POST['subject']), str_replace($from_member, $to_member, $_POST['message']), null, 'news', !empty($_POST['send_html']),
5);


replace with


// Don't sent it twice!
unset($context['recipients']['emails'][$k]);

// Dammit - can't PM emails!
if ($context['send_pm'])
continue;


// Newsletter Pro
// Send single emails
// Check subject is empty
if (empty($_POST['subject']))
fatal_error("Unable to send subject is empty",false);

// Check if message is empty
if (empty($_POST['message']))
fatal_error("Unable to send message is empty",false);


$emailID = 0;
if (empty($context['send_pm']))
{
$email_query = "INSERT INTO " . $temptable  . " (ID_LETTER,email) VALUES ";

// Replace bad characters

$email = str_replace("'","", $email);

$email_query .= "('" . $context['ID_LETTER'] . "','" . $email . "'),";

$email_query .= "]]";
$email_query = str_replace(",]]","",$email_query);
$smcFunc['db_query']('', $email_query);
$emailID = $smcFunc['db_insert_id']($temptable, 'ID_EMAIL');

$smcFunc['db_query']('', "UPDATE {db_prefix}newspro_newsletters SET sent = sent + 1 WHERE ID_LETTER = "  . $context['ID_LETTER']);
}


$message = str_replace("#ID_EMAIL#",$emailID,$_POST['message']);

global $boardurl;
$message = str_replace("EMAILHASH",sha1($email . $boardurl),$message);

// End Send Singe emails
// End Newsletter Pro

$to_member = array(
$email,
!empty($_POST['send_html']) ? '<a href="mailto:' . $email . '">' . $email . '</a>' : $email,
'??',
$email,
$unsubscribe_link,
);

sendmail($email, str_replace($from_member, $to_member, $_POST['subject']), str_replace($from_member, $to_member, $_POST['message']), null, 'news', !empty($_POST['send_html']), 5);

so do i simply replace the above code and the error is cleared ? .
Title: Re: just purchased and uploaded newsletter pro to package manager getting an error
Post by: SMFHacks on May 01, 2022, 12:15:46 pm
Have a fix download at https://www.smfhacks.com/index.php/topic,2407.msg11756.html#msg11756 download the latest one.
Title: Re: just purchased and uploaded newsletter pro to package manager getting an error
Post by: geminiman on May 01, 2022, 12:40:43 pm
hi and thanks . i downloaded the above version . is there a guide / tutorial on here in regards using this mod ? .
Title: Re: just purchased and uploaded newsletter pro to package manager getting an error
Post by: SMFHacks on May 01, 2022, 01:28:26 pm
There is not a guide. Basically you can send a newsletter now with an html editor, view/click and unsubscribe tracking.
Also, an option to manually schedule campaigns requires a cron job setup though.