mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-06-26 16:31:38 +02:00
enhacements to email verification tool
This commit is contained in:
@@ -73,7 +73,7 @@ class secMiddleware:
|
||||
or key == 'imageByPass' or key == 'passwordByPass' or key == 'cronCommand' \
|
||||
or key == 'emailMessage' or key == 'configData' or key == 'rewriteRules' \
|
||||
or key == 'modSecRules' or key == 'recordContentTXT' or key == 'SecAuditLogRelevantStatus' \
|
||||
or key == 'fileContent' or key == 'commands' or key == 'gitHost':
|
||||
or key == 'fileContent' or key == 'commands' or key == 'gitHost' or key == 'ipv6':
|
||||
continue
|
||||
if value.find(';') > -1 or value.find('&&') > -1 or value.find('|') > -1 or value.find('...') > -1 \
|
||||
or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(")") > -1 \
|
||||
|
||||
@@ -81,6 +81,49 @@ class emailMarketing(multi.Thread):
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], str(msg) +'. [404]')
|
||||
return 0
|
||||
|
||||
def findNextIP(self):
|
||||
try:
|
||||
if self.delayData['rotation'] == 'Disable':
|
||||
return None
|
||||
elif self.delayData['rotation'] == 'IPv4':
|
||||
if self.delayData['ipv4'].find(',') == -1:
|
||||
return self.delayData['ipv4']
|
||||
else:
|
||||
ipv4s = self.delayData['ipv4'].split(',')
|
||||
|
||||
if self.currentIP == '':
|
||||
return ipv4s[0]
|
||||
else:
|
||||
returnCheck = 0
|
||||
|
||||
for items in ipv4s:
|
||||
if returnCheck == 1:
|
||||
return items
|
||||
if items == self.currentIP:
|
||||
returnCheck = 1
|
||||
|
||||
return ipv4s[0]
|
||||
else:
|
||||
if self.delayData['ipv6'].find(',') == -1:
|
||||
return self.delayData['ipv6']
|
||||
else:
|
||||
ipv6 = self.delayData['ipv6'].split(',')
|
||||
|
||||
if self.currentIP == '':
|
||||
return ipv6[0]
|
||||
else:
|
||||
returnCheck = 0
|
||||
|
||||
for items in ipv6:
|
||||
if returnCheck == 1:
|
||||
return items
|
||||
if items == self.currentIP:
|
||||
returnCheck = 1
|
||||
return ipv6[0]
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
return None
|
||||
|
||||
def verificationJob(self):
|
||||
try:
|
||||
|
||||
@@ -97,6 +140,16 @@ class emailMarketing(multi.Thread):
|
||||
counter = 1
|
||||
allEmailsInList = verificationList.emailsinlist_set.all()
|
||||
|
||||
configureVerifyPath = '/home/cyberpanel/configureVerify'
|
||||
finalPath = '%s/%s' % (configureVerifyPath, domain)
|
||||
|
||||
counterGlobal = 0
|
||||
|
||||
import json
|
||||
if os.path.exists(finalPath):
|
||||
self.delayData = json.loads(open(finalPath, 'r').read())
|
||||
|
||||
self.currentIP = ''
|
||||
|
||||
for items in allEmailsInList:
|
||||
if items.verificationStatus != 'Verified':
|
||||
@@ -109,7 +162,53 @@ class emailMarketing(multi.Thread):
|
||||
# Get local server hostname
|
||||
host = socket.gethostname()
|
||||
|
||||
server = smtplib.SMTP()
|
||||
if os.path.exists(finalPath):
|
||||
try:
|
||||
logging.CyberCPLogFileWriter.writeToFile('Checking if delay is enabled for verification..')
|
||||
delay = self.delayData['delay']
|
||||
if delay == 'Enable':
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'It seems delay is enabled...')
|
||||
if counterGlobal == int(self.delayData['delayAfter']):
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'Sleeping for %s seconds...' % (self.delayData['delayTime']))
|
||||
time.sleep(int(self.delayData['delayTime']))
|
||||
counterGlobal = 0
|
||||
self.currentIP = self.findNextIP()
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'IP in use: %s.' % (str(self.currentIP)))
|
||||
|
||||
if self.currentIP == None:
|
||||
server = smtplib.SMTP()
|
||||
else:
|
||||
server = smtplib.SMTP(self.currentIP)
|
||||
else:
|
||||
|
||||
if self.currentIP == '':
|
||||
self.currentIP = self.findNextIP()
|
||||
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'IP in use: %s.' % (str(self.currentIP)))
|
||||
|
||||
if self.currentIP == None:
|
||||
server = smtplib.SMTP()
|
||||
else:
|
||||
server = smtplib.SMTP(self.currentIP)
|
||||
else:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'Delay not configured..')
|
||||
server = smtplib.SMTP()
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'Delay not configured.. Error: %s' % (str(msg)))
|
||||
server = smtplib.SMTP()
|
||||
else:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
'Delay not configured..')
|
||||
server = smtplib.SMTP()
|
||||
|
||||
|
||||
server.set_debuglevel(0)
|
||||
|
||||
# SMTP Conversation
|
||||
@@ -126,7 +225,7 @@ class emailMarketing(multi.Thread):
|
||||
break
|
||||
else:
|
||||
items.verificationStatus = 'Verification Failed'
|
||||
logging.CyberCPLogFileWriter.writeToFile(email + " verification failed with error: " + message)
|
||||
logging.CyberCPLogFileWriter.writeToFile(email + " verification failed with error: " + message.decode())
|
||||
items.save()
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, str(counter) + ' emails verified so far..')
|
||||
@@ -137,6 +236,9 @@ class emailMarketing(multi.Thread):
|
||||
counter = counter + 1
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg))
|
||||
|
||||
|
||||
counterGlobal = counterGlobal + 1
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, str(counter) + ' emails successfully verified. [200]')
|
||||
except BaseException as msg:
|
||||
verificationList = EmailLists.objects.get(listName=self.extraArgs['listName'])
|
||||
|
||||
@@ -181,6 +181,58 @@ class EmailMarketingManager:
|
||||
except KeyError as msg:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
def configureVerify(self):
|
||||
try:
|
||||
userID = self.request.session['userID']
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
admin = Administrator.objects.get(pk=userID)
|
||||
|
||||
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
|
||||
pass
|
||||
else:
|
||||
return ACLManager.loadError()
|
||||
|
||||
if emACL.checkIfEMEnabled(admin.userName) == 0:
|
||||
return ACLManager.loadError()
|
||||
|
||||
return render(self.request, 'emailMarketing/configureVerify.html', {'domain': self.domain})
|
||||
except KeyError as msg:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
def saveConfigureVerify(self):
|
||||
try:
|
||||
|
||||
userID = self.request.session['userID']
|
||||
admin = Administrator.objects.get(pk=userID)
|
||||
|
||||
if emACL.checkIfEMEnabled(admin.userName) == 0:
|
||||
return ACLManager.loadErrorJson()
|
||||
|
||||
data = json.loads(self.request.body)
|
||||
|
||||
domain = data['domain']
|
||||
|
||||
configureVerifyPath = '/home/cyberpanel/configureVerify'
|
||||
|
||||
import os
|
||||
|
||||
if not os.path.exists(configureVerifyPath):
|
||||
os.mkdir(configureVerifyPath)
|
||||
|
||||
finalPath = '%s/%s' % (configureVerifyPath, domain)
|
||||
|
||||
writeToFile = open(finalPath, 'w')
|
||||
writeToFile.write(self.request.body.decode())
|
||||
writeToFile.close()
|
||||
|
||||
data_ret = {"status": 1}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
except BaseException as msg:
|
||||
final_dic = {'status': 0, 'error_message': str(msg)}
|
||||
final_json = json.dumps(final_dic)
|
||||
return HttpResponse(final_json)
|
||||
|
||||
def fetchEmails(self):
|
||||
try:
|
||||
|
||||
|
||||
@@ -1330,4 +1330,87 @@ app.controller('sendEmailsCTRL', function ($scope, $http, $timeout) {
|
||||
};
|
||||
});
|
||||
|
||||
app.controller('configureVerify', function ($scope, $http) {
|
||||
|
||||
$scope.cyberPanelLoading = true;
|
||||
$scope.ipv4Hidden = true;
|
||||
$scope.ipv6Hidden = true;
|
||||
$scope.delayHidden = true;
|
||||
|
||||
$scope.delayInitial = function () {
|
||||
if ($scope.delay === 'Disable') {
|
||||
$scope.delayHidden = true;
|
||||
} else {
|
||||
$scope.delayHidden = false;
|
||||
}
|
||||
};
|
||||
$scope.rotateInitial = function () {
|
||||
if ($scope.rotation === 'Disable') {
|
||||
$scope.rotationHidden = true;
|
||||
} else if ($scope.rotation === 'IPv4') {
|
||||
$scope.ipv4Hidden = false;
|
||||
$scope.ipv6Hidden = true;
|
||||
} else {
|
||||
$scope.ipv4Hidden = true;
|
||||
$scope.ipv6Hidden = false;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.saveChanges = function () {
|
||||
|
||||
$scope.cyberPanelLoading = false;
|
||||
|
||||
url = "/emailMarketing/saveConfigureVerify";
|
||||
|
||||
var data = {
|
||||
domain: $("#domainName").text(),
|
||||
rotation: $scope.rotation,
|
||||
delay: $scope.delay,
|
||||
delayAfter: $scope.delayAfter,
|
||||
delayTime: $scope.delayTime,
|
||||
ipv4: $scope.ipv4,
|
||||
ipv6: $scope.ipv6
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
|
||||
if (response.data.status === 1) {
|
||||
|
||||
new PNotify({
|
||||
title: 'Success!',
|
||||
text: 'Successfully saved verification settings.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = false;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
99
emailMarketing/templates/emailMarketing/configureVerify.html
Executable file
99
emailMarketing/templates/emailMarketing/configureVerify.html
Executable file
@@ -0,0 +1,99 @@
|
||||
{% extends "baseTemplate/index.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Configure Email Verification - CyberPanel" %}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{% load static %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "Configure Email Verification" %}</h2>
|
||||
<p>{% trans "On this page you can configure parameters regarding how email verification is performed for " %}<span id="domainName">{{ domain }}</span></p>
|
||||
</div>
|
||||
<div ng-controller="configureVerify" class="panel">
|
||||
<div class="panel-body">
|
||||
<h3 class="title-hero">
|
||||
{% trans "Compose Email Message" %} <img ng-hide="cyberPanelLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</h3>
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
|
||||
<form action="/" class="form-horizontal bordered-row">
|
||||
|
||||
<!---- Create Email Template --->
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Configure Delay" %} </label>
|
||||
<div class="col-sm-6">
|
||||
<select ng-change="delayInitial()" ng-model="delay" class="form-control">
|
||||
<option>Disable</option>
|
||||
<option>Enable</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="delayHidden" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Delay After" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input placeholder="{% trans 'Start delay after this many verifications are done.' %}" type="number" class="form-control" ng-model="delayAfter" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="delayHidden" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Delay Time" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input placeholder="{% trans 'Set the number of seconds to wait.' %}" type="number" class="form-control" ng-model="delayTime" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "IP Rotation" %} </label>
|
||||
<div class="col-sm-6">
|
||||
<select ng-change="rotateInitial()" ng-model="rotation" class="form-control">
|
||||
<option>Disable</option>
|
||||
<option>IPv4</option>
|
||||
<option>IPv6</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="ipv4Hidden" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv4" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input placeholder="{% trans 'Enter IPv4(s) to be used separate with commas, subnet is also allowed.' %}" type="text" class="form-control" ng-model="ipv4" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="ipv6Hidden" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv6" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input placeholder="{% trans 'Enter IPv6(s) to be used separate with commas, subnet is also allowed.' %}" type="text" class="form-control" ng-model="ipv6" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="saveChanges()"
|
||||
class="btn btn-primary btn-lg btn-block">{% trans "Save" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!---- Create Email Template --->
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -3,188 +3,207 @@
|
||||
{% block title %}{% trans "Manage Email Lists - CyberPanel" %}{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{% load static %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
{% load static %}
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "Manage Email Lists" %} - <span id="domainNamePage">{{ domain }}</span></h2>
|
||||
<p>{% trans "On this page you can manage your email lists (Delete, Verify, Add More Emails)." %}</p>
|
||||
</div>
|
||||
<div ng-controller="manageEmailLists" class="panel">
|
||||
<div class="panel-body">
|
||||
<h3 class="title-hero">
|
||||
{% trans "Manage Email Lists" %} <img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
|
||||
</h3>
|
||||
<div class="example-box-wrapper">
|
||||
<div class="container">
|
||||
<div id="page-title">
|
||||
<h2>{% trans "Manage Email Lists" %} - <span id="domainNamePage">{{ domain }}</span></h2>
|
||||
<p>{% trans "On this page you can manage your email lists (Delete, Verify, Add More Emails)." %}</p>
|
||||
</div>
|
||||
<div ng-controller="manageEmailLists" class="panel">
|
||||
<div class="panel-body">
|
||||
<h3 class="title-hero">
|
||||
{% trans "Manage Email Lists" %} <img ng-hide="cyberPanelLoading"
|
||||
src="{% static 'images/loading.gif' %}">
|
||||
</h3>
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
|
||||
<form action="/" class="form-horizontal bordered-row">
|
||||
<form action="/" class="form-horizontal bordered-row">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Select List" %} </label>
|
||||
<div class="col-sm-6">
|
||||
<select ng-change="fetchEmails(1)" ng-model="listName" class="form-control">
|
||||
{% for items in listNames %}
|
||||
<option>{{ items }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Select List" %} </label>
|
||||
<div class="col-sm-6">
|
||||
<select ng-change="fetchEmails(1)" ng-model="listName" class="form-control">
|
||||
{% for items in listNames %}
|
||||
<option>{{ items }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="currentRecords" class="form-group">
|
||||
<label class="col-sm-1 control-label"></label>
|
||||
<div class="col-sm-3">
|
||||
<button data-toggle="modal" data-target="#deleteList" class="btn ra-100 btn-danger">{% trans 'Delete This List' %}</button>
|
||||
<!--- Delete Pool --->
|
||||
<div class="modal fade" id="deleteList" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "You are doing to delete this list.." %} <img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>{% trans 'Are you sure?' %}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans 'Close' %}</button>
|
||||
<button data-dismiss="modal" ng-click="deleteList()" type="button" class="btn btn-primary">{% trans 'Confirm' %}</button>
|
||||
<div ng-hide="currentRecords" class="form-group">
|
||||
<div class="col-sm-3">
|
||||
<button data-toggle="modal" data-target="#deleteList"
|
||||
class="btn ra-100 btn-danger">{% trans 'Delete This List' %}</button>
|
||||
<!--- Delete Pool --->
|
||||
<div class="modal fade" id="deleteList" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×
|
||||
</button>
|
||||
<h4 class="modal-title">{% trans "You are doing to delete this list.." %}
|
||||
<img ng-hide="cyberPanelLoading"
|
||||
src="{% static 'images/loading.gif' %}"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>{% trans 'Are you sure?' %}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{% trans 'Close' %}</button>
|
||||
<button data-dismiss="modal" ng-click="deleteList()" type="button"
|
||||
class="btn btn-primary">{% trans 'Confirm' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--- Delete Pool --->
|
||||
</div>
|
||||
<!--- Delete Pool --->
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<button ng-disabled="verificationButton" ng-click="startVerification()" class="btn ra-100 btn-blue-alt">{% trans 'Verify This List' %}</button>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<button ng-click="showAddEmails()" class="btn ra-100 btn-blue-alt">{% trans 'Add More Emails' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!---- Create Email List --->
|
||||
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input placeholder="Path to emails file (.txt and .csv accepted)" type="text" class="form-control" ng-model="path" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="createEmailList()" class="btn btn-primary btn-lg btn-block">{% trans "Load Emails" %}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatus $}</h2>
|
||||
<div class="col-sm-3">
|
||||
<button ng-disabled="verificationButton" ng-click="startVerification()"
|
||||
class="btn ra-100 btn-blue-alt">{% trans 'Verify This List' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()" class="btn btn-primary btn-lg btn-block">{% trans "Go Back" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!---- Create Email List --->
|
||||
|
||||
<!---- Email List Verification --->
|
||||
|
||||
<div ng-hide="verificationStatus" class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatusVerification $}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!---- Create Email List --->
|
||||
|
||||
|
||||
<!------ List of records --------------->
|
||||
|
||||
<div ng-hide="currentRecords" class="form-group">
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input placeholder="Search Emails..." ng-model="searchEmails" name="dom" type="text" class="form-control" ng-model="domainNameCreate" required>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 1%;" class="col-sm-2">
|
||||
<select ng-change="fetchRecords()" ng-model="recordstoShow" class="form-control">
|
||||
<option>10</option>
|
||||
<option>50</option>
|
||||
<option>100</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "ID" %}</th>
|
||||
<th>{% trans "email" %}</th>
|
||||
<th>{% trans "Verification Status" %}</th>
|
||||
<th>{% trans "Date Created" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="record in records | filter:searchEmails">
|
||||
<td ng-bind="record.id"></td>
|
||||
<td ng-bind="record.email"></td>
|
||||
<td ng-bind="record.verificationStatus"></td>
|
||||
<td ng-bind="record.dateCreated"></td>
|
||||
<td >
|
||||
<button type="button" ng-click="deleteEmail(record.id)" class="btn ra-100 btn-purple">{% trans "Delete" %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-sm-offset-8">
|
||||
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination">
|
||||
<li ng-click="fetchEmails(page)" ng-repeat="page in pagination"><a href="">{$ page $}</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<a target="_blank" href="/emailMarketing/{{ domain }}/configureVerify">
|
||||
<div class="col-sm-3">
|
||||
<button class="btn ra-100 btn-blue-alt">{% trans 'Configure Verification Settings' %}</button>
|
||||
</div>
|
||||
</a>
|
||||
<div class="col-sm-3">
|
||||
<button ng-click="showAddEmails()"
|
||||
class="btn ra-100 btn-blue-alt">{% trans 'Add More Emails' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!---- Create Email List --->
|
||||
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input placeholder="Path to emails file (.txt and .csv accepted)" type="text"
|
||||
class="form-control" ng-model="path" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationDetailsForm" class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-click="createEmailList()"
|
||||
class="btn btn-primary btn-lg btn-block">{% trans "Load Emails" %}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatus $}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-hide="installationProgress" class="form-group">
|
||||
<label class="col-sm-3 control-label"></label>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
|
||||
class="btn btn-primary btn-lg btn-block">{% trans "Go Back" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!---- Create Email List --->
|
||||
|
||||
<!---- Email List Verification --->
|
||||
|
||||
<div ng-hide="verificationStatus" class="form-group">
|
||||
<label class="col-sm-2 control-label"></label>
|
||||
<div class="col-sm-7">
|
||||
<div class="alert alert-success text-center">
|
||||
<h2>{$ currentStatusVerification $}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!---- Create Email List --->
|
||||
|
||||
|
||||
<!------ List of records --------------->
|
||||
|
||||
<div ng-hide="currentRecords" class="form-group">
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input placeholder="Search Emails..." ng-model="searchEmails" name="dom" type="text"
|
||||
class="form-control" ng-model="domainNameCreate" required>
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 1%;" class="col-sm-2">
|
||||
<select ng-change="fetchRecords()" ng-model="recordstoShow" class="form-control">
|
||||
<option>10</option>
|
||||
<option>50</option>
|
||||
<option>100</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12">
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "ID" %}</th>
|
||||
<th>{% trans "email" %}</th>
|
||||
<th>{% trans "Verification Status" %}</th>
|
||||
<th>{% trans "Date Created" %}</th>
|
||||
<th>{% trans "Actions" %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="record in records | filter:searchEmails">
|
||||
<td ng-bind="record.id"></td>
|
||||
<td ng-bind="record.email"></td>
|
||||
<td ng-bind="record.verificationStatus"></td>
|
||||
<td ng-bind="record.dateCreated"></td>
|
||||
<td>
|
||||
<button type="button" ng-click="deleteEmail(record.id)"
|
||||
class="btn ra-100 btn-purple">{% trans "Delete" %}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4 col-sm-offset-8">
|
||||
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination">
|
||||
<li ng-click="fetchEmails(page)" ng-repeat="page in pagination"><a
|
||||
href="">{$ page $}</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!------ List of records --------------->
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!------ List of records --------------->
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -4,10 +4,12 @@ urlpatterns = [
|
||||
url(r'^$', views.emailMarketing, name='emailMarketing'),
|
||||
url(r'^fetchUsers$', views.fetchUsers, name='fetchUsers'),
|
||||
url(r'^enableDisableMarketing$', views.enableDisableMarketing, name='enableDisableMarketing'),
|
||||
url(r'^saveConfigureVerify$', views.saveConfigureVerify, name='saveConfigureVerify'),
|
||||
url(r'^(?P<domain>(.*))/emailLists$', views.createEmailList, name='createEmailList'),
|
||||
url(r'^submitEmailList$', views.submitEmailList, name='submitEmailList'),
|
||||
url(r'^(?P<domain>(.*))/manageLists$', views.manageLists, name='manageLists'),
|
||||
url(r'^(?P<domain>(.*))/manageSMTP$', views.manageSMTP, name='manageSMTP'),
|
||||
url(r'^(?P<domain>(.*))/configureVerify$', views.configureVerify, name='configureVerify'),
|
||||
url(r'^fetchEmails$', views.fetchEmails, name='fetchEmails'),
|
||||
url(r'^deleteList$', views.deleteList, name='deleteList'),
|
||||
url(r'^emailVerificationJob$', views.emailVerificationJob, name='emailVerificationJob'),
|
||||
|
||||
@@ -54,6 +54,22 @@ def manageLists(request, domain):
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
def configureVerify(request, domain):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
emm = EmailMarketingManager(request, domain)
|
||||
return emm.configureVerify()
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
def saveConfigureVerify(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
emm = EmailMarketingManager(request)
|
||||
return emm.saveConfigureVerify()
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
def fetchEmails(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
Reference in New Issue
Block a user