"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "includes/sp-common.php" between
seopanel.v.4.5.0.zip and seopanel.v.4.6.0.zip

About: Seo Panel is a seo control panel for managing search engine optimization of your websites.

sp-common.php  (seopanel.v.4.5.0):sp-common.php  (seopanel.v.4.6.0)
skipping to change at line 473 skipping to change at line 473
$mail->Subject = $subject; $mail->Subject = $subject;
$mail->Body = $content; $mail->Body = $content;
$mail->msgHTML($content); //creates plaintext alternate automatically $mail->msgHTML($content); //creates plaintext alternate automatically
$mail->AltBody = 'To view the message, please use an HTML compatible emai l viewer!'; //fallback $mail->AltBody = 'To view the message, please use an HTML compatible emai l viewer!'; //fallback
// if attachments are there // if attachments are there
if (!empty($attachment)) { if (!empty($attachment)) {
$mail->AddAttachment($attachment); $mail->AddAttachment($attachment);
} }
$mailLogInfo = [];
// if sendgrid api should be used, if enabled it // if sendgrid api should be used, if enabled it
if ($mail->Host == 'smtp.sendgrid.net' && SP_SENDGRID_API) { if ($mail->Host == 'smtp.sendgrid.net' && SP_SENDGRID_API) {
$sendLog = sendMailBySendgridAPI($mail, $to); $sendLog = sendMailBySendgridAPI($mail, $to);
$mailLogInfo['mail_category'] = 'sendgrid';
} else { } else {
// normal mail send fails or not // normal mail send fails or not
if($mail->Send()){ if($mail->Send()){
$sendLog['status'] = 1; $sendLog['status'] = 1;
$sendLog['log_message'] = "Success"; $sendLog['log_message'] = "Success";
return true;
} else { } else {
$sendLog['status'] = 0; $sendLog['status'] = 0;
$sendLog['log_message'] = $mail->ErrorInfo; $sendLog['log_message'] = $mail->ErrorInfo;
} }
} }
// update mail log
$crawlLogCtrl = new CrawlLogController();
$mailLogInfo['subject'] = $subject;
$mailLogInfo['from_address'] = $from;
$mailLogInfo['to_address'] = $to;
$mailLogInfo['status'] = $sendLog['status'];
$mailLogInfo['log_message'] = $sendLog['log_message'];
$crawlLogCtrl->createMailLog($mailLogInfo);
return $sendLog['status']; return $sendLog['status'];
} }
function sendMailBySendgridAPI($mail, $subscriberEmail, $subscriberName = '') { function sendMailBySendgridAPI($mail, $subscriberEmail, $subscriberName = '') {
include_once(SP_LIBPATH . "/sendgrid-php/sendgrid-php.php"); include_once(SP_LIBPATH . "/sendgrid-php/sendgrid-php.php");
$from = new SendGrid\Email($mail->FromName, $mail->From); $from = new SendGrid\Email($mail->FromName, $mail->From);
$subject = $mail->Subject; $subject = $mail->Subject;
$to = new SendGrid\Email($subscriberName, $subscriberEmail); $to = new SendGrid\Email($subscriberName, $subscriberEmail);
skipping to change at line 756 skipping to change at line 767
$number = str_replace("B", "", trim($number)); $number = str_replace("B", "", trim($number));
$number = $number * 1000000000; $number = $number * 1000000000;
} }
return $number; return $number;
} }
function showExportDiv($pdfLink, $csvLink, $printLink) { function showExportDiv($pdfLink, $csvLink, $printLink) {
?> ?>
<div class="export_div"> <div class="export_div">
<a href="<?php echo $pdfLink?>"><i class="fas fa-file-pdf"></i></ a> <a href="<?php echo $pdfLink?>" target="_blank"><i class="fas fa- file-pdf"></i></a>
<a href="<?php echo $csvLink?>"><i class="fas fa-file-csv"></i></ a> <a href="<?php echo $csvLink?>"><i class="fas fa-file-csv"></i></ a>
<a target="_blank" href="<?php echo $printLink?>"><i class="fas f a-print"></i></a> <a target="_blank" href="<?php echo $printLink?>"><i class="fas f a-print"></i></a>
</div> </div>
<?php <?php
} }
function timeElapsedString($datetime, $full = false) { function timeElapsedString($datetime, $full = false) {
$now = new DateTime; $now = new DateTime;
$ago = new DateTime($datetime); $ago = new DateTime($datetime);
$diff = $now->diff($ago); $diff = $now->diff($ago);
 End of changes. 5 change blocks. 
2 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)