mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 09:46:11 +01:00
bug fix: email marketing tool
This commit is contained in:
@@ -188,12 +188,21 @@ class emailMarketing(multi.Thread):
|
||||
|
||||
tempPath = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||
|
||||
emailJob = EmailJobs(owner=emailMessage, date=time.strftime("%I-%M-%S-%a-%b-%Y"),
|
||||
host=self.extraArgs['host'], totalEmails=totalEmails,
|
||||
sent=sent, failed=failed
|
||||
)
|
||||
emailJob.save()
|
||||
|
||||
for items in allEmails:
|
||||
try:
|
||||
message = MIMEMultipart('alternative')
|
||||
message['Subject'] = emailMessage.subject
|
||||
message['From'] = emailMessage.fromEmail
|
||||
message['reply-to'] = emailMessage.replyTo
|
||||
if (items.verificationStatus == 'Verified' or self.extraArgs['verificationCheck']) and not items.verificationStatus == 'REMOVED':
|
||||
|
||||
if (items.verificationStatus == 'Verified' or self.extraArgs[
|
||||
'verificationCheck']) and not items.verificationStatus == 'REMOVED':
|
||||
try:
|
||||
|
||||
removalLink = "https:\/\/" + ipAddress + ":8090\/emailMarketing\/remove\/" + self.extraArgs[
|
||||
@@ -232,15 +241,29 @@ class emailMarketing(multi.Thread):
|
||||
|
||||
smtpServer.sendmail(message['From'], items.email, message.as_string())
|
||||
sent = sent + 1
|
||||
emailJob.sent = sent
|
||||
emailJob.save()
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||
'Successfully sent: ' + str(sent) + ' Failed: ' + str(
|
||||
'Successfully sent: ' + str(
|
||||
sent) + ' Failed: ' + str(
|
||||
failed))
|
||||
except BaseException as msg:
|
||||
failed = failed + 1
|
||||
emailJob.failed = failed
|
||||
emailJob.save()
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||
'Successfully sent: ' + str(
|
||||
sent) + ', Failed: ' + str(failed))
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
except BaseException as msg:
|
||||
failed = failed + 1
|
||||
emailJob.failed = failed
|
||||
emailJob.save()
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||
'Successfully sent: ' + str(
|
||||
sent) + ', Failed: ' + str(failed))
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
|
||||
emailJob = EmailJobs(owner=emailMessage, date=time.strftime("%I-%M-%S-%a-%b-%Y"),
|
||||
host=self.extraArgs['host'], totalEmails=totalEmails,
|
||||
|
||||
@@ -684,7 +684,7 @@ class EmailMarketingManager:
|
||||
em = EM('startEmailJob', extraArgs)
|
||||
em.start()
|
||||
|
||||
time.sleep(2)
|
||||
time.sleep(5)
|
||||
|
||||
data_ret = {"status": 1, 'tempStatusPath': extraArgs['tempStatusPath']}
|
||||
json_data = json.dumps(data_ret)
|
||||
|
||||
Reference in New Issue
Block a user