PATH:
home
/
letacommog
/
crmleta
<?php //////////////////////////////////////////////////// // PHPMailer - PHP email class // // Class for sending email using either // sendmail, PHP mail(), or SMTP. Methods are // based upon the standard AspEmail(tm) classes. // // Copyright (C) 2001 - 2003 Brent R. Matzelle // // License: LGPL, see LICENSE //////////////////////////////////////////////////// /** * PHPMailer - PHP email transport class * @package PHPMailer * @author Brent R. Matzelle * @copyright 2001 - 2003 Brent R. Matzelle */ require_once('include/utils/utils.php'); require("modules/Emails/mail.php"); require_once('include/logging.php'); require("config.php"); global $adb; global $log; global $HELPDESK_SUPPORT_EMAIL_ID,$HELPDESK_SUPPORT_NAME; $log =& LoggerManager::getLogger('SendSupportNotification'); $log->debug(" invoked SendSupportNotification "); // retrieve the translated strings. $app_strings = return_application_language($current_language); //To send email notification before a week $query="select vtiger_contactdetails.contactid,vtiger_contactdetails.email,vtiger_contactdetails.firstname,vtiger_contactdetails.lastname,contactid from vtiger_customerdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_customerdetails.customerid inner join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_customerdetails.customerid where vtiger_crmentity.deleted=0 and support_end_date=DATE_ADD(now(), INTERVAL 1 WEEK)"; $result = $adb->pquery($query, array()); if($adb->num_rows($result) >= 1) { while($result_set = $adb->fetch_array($result)) { $content=getcontent_week($result_set["contactid"]); $body=$content["body"]; $body = str_replace('$logo$','<img src="cid:logo" />',$body); $subject=$content["subject"]; $status=send_mail("Support",$result_set["email"],$HELPDESK_SUPPORT_NAME,$HELPDESK_SUPPORT_EMAIL_ID,$subject,$body,'',$HELPDESK_SUPPORT_EMAIL_ID ); } } //comment / uncomment this line if you want to hide / show the sent mail status //showstatus($status); $log->debug(" Send Support Notification Before a week - Status: ".$status); //To send email notification before a month $query="select vtiger_contactdetails.contactid,vtiger_contactdetails.email,vtiger_contactdetails.firstname,vtiger_contactdetails.lastname,contactid from vtiger_customerdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_customerdetails.customerid inner join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_customerdetails.customerid where vtiger_crmentity.deleted=0 and support_end_date=DATE_ADD(now(), INTERVAL 1 MONTH)"; $result = $adb->pquery($query, array()); if($adb->num_rows($result) >= 1) { while($result_set = $adb->fetch_array($result)) { $content=getcontent_month($result_set["contactid"]); $body=$content["body"]; $body = str_replace('$logo$','<img src="cid:logo" />',$body); $subject=$content["subject"]; $status=send_mail("Support",$result_set["email"],$HELPDESK_SUPPORT_NAME,$HELPDESK_SUPPORT_EMAIL_ID,$subject,$body,'',$HELPDESK_SUPPORT_EMAIL_ID); } } //comment / uncomment this line if you want to hide / show the sent mail status //showstatus($status); $log->debug(" Send Support Notification Befoe a Month - Status: ".$status); //used to dispaly the sent mail status function showstatus($status) { if($status == 1) echo "Mails sent successfully"; else if($status == "") echo "No contacts matched"; else echo "Error while sending mails: ".$status; } //function used to get the header and body content of the mail to be sent. function getcontent_month($id) { global $adb; $query='select vtiger_emailtemplates.subject,vtiger_emailtemplates.body from vtiger_notificationscheduler inner join vtiger_emailtemplates on vtiger_emailtemplates.templateid=vtiger_notificationscheduler.notificationbody where schedulednotificationid=7'; $result = $adb->pquery($query, array()); $body=$adb->query_result($result,0,'body'); $body=getMergedDescription($body,$id,"Contacts"); $body=getMergedDescription($body,$id,"Users"); $res_array["subject"]=$adb->query_result($result,0,'subject'); $res_array["body"]=$body; return $res_array; } //function used to get the header and body content of the mail to be sent. function getcontent_week($id) { global $adb; $query='select vtiger_emailtemplates.subject,vtiger_emailtemplates.body from vtiger_notificationscheduler inner join vtiger_emailtemplates on vtiger_emailtemplates.templateid=vtiger_notificationscheduler.notificationbody where schedulednotificationid=6'; $result = $adb->pquery($query, array()); $body=$adb->query_result($result,0,'body'); $body=getMergedDescription($body,$id,"Contacts"); $body=getMergedDescription($body,$id,"Users"); $res_array["subject"]=$adb->query_result($result,0,'subject'); $res_array["body"]=$body; return $res_array; } ?>
[+]
..
[-] rnqbcnev.php
[edit]
[+]
license
[-] fugveiqp.php
[edit]
[+]
include
[-] config.security.php
[edit]
[+]
vtlib
[+]
soap
[-] sadtbusf.php
[edit]
[+]
includes
[-] parent_tabdata.php
[edit]
[-] shorturl.php
[edit]
[-] forgotPassword.php
[edit]
[-] nkfngbxn.php
[edit]
[-] jaklzfte.php
[edit]
[+]
migrate
[-] .htaccess
[edit]
[-] favicon.ico
[edit]
[-] about.php
[edit]
[+]
cron
[-] config.csrf-secret.php
[edit]
[-] vtigerversion.php
[edit]
[-] robots.txt
[edit]
[-] izbcvwpg.php
[edit]
[+]
user_privileges
[-] SPL-1.1.2.txt
[edit]
[+]
storage
[-] LICENSE.txt
[edit]
[-] zwzvzhuf.php
[edit]
[-] SendSupportNotification.php
[edit]
[-] vtigerservice.php
[edit]
[+]
consumerportal
[+]
modules
[-] Copyright.txt
[edit]
[+]
resources
[+]
libraries
[+]
data
[+]
cache
[+]
layouts
[-] config.performance.php
[edit]
[-] olkycafm.php
[edit]
[-] config.inc.php
[edit]
[-] htaccess.txt
[edit]
[-] vtigercron.php
[edit]
[-] rzhyqmcf.php
[edit]
[-] PEAR.php
[edit]
[-] config_override.php
[edit]
[-] config.db.php
[edit]
[+]
assets
[-] tabdata.php
[edit]
[-] Release_Notes.html
[edit]
[-] phpversionfail.php
[edit]
[-] connection.php
[edit]
[-] google12bf33bc0b095a34.html
[edit]
[+]
test
[-] webservice.php
[edit]
[-] README.md
[edit]
[-] config.template.php
[edit]
[-] jytvfhlh.php
[edit]
[-] xphdvzfz.php
[edit]
[+]
logs
[-] config.php
[edit]
[-] log4php.properties
[edit]
[-] ugbidzzi.php
[edit]
[-] index.php
[edit]
[+]
packages
[+]
kcfinder
[+]
languages
[+]
schema
[-] copyright.html
[edit]