From 3d8126e981b3047c076c7e4605d29e1f4a37bf92 Mon Sep 17 00:00:00 2001 From: William Woodson Date: Sun, 21 Feb 2016 10:40:26 -0600 Subject: [PATCH] Started frontend work for sending test email from sending_profiles page. This will need to wait for rewrite of /util/send_test_email to send with default template, etc. --- static/js/app/sending_profiles.js | 34 ++++++++++++++++++++++++ templates/sending_profiles.html | 44 +++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/static/js/app/sending_profiles.js b/static/js/app/sending_profiles.js index da8a4ca6..72edced0 100644 --- a/static/js/app/sending_profiles.js +++ b/static/js/app/sending_profiles.js @@ -1,5 +1,39 @@ var profiles = [] +// Attempts to send a test email by POSTing to /campaigns/ +/*function sendTestEmail() { + var test_email_request = { + template: { name: '' }, + first_name: $("input[name=to_first_name]").val(), + last_name: $("input[name=to_last_name]").val(), + email: $("input[name=to_email]").val(), + position: $("input[name=to_position]").val(), + url: '', + page: { name: '' }, + smtp: { + from_address: $("#from").val(), + host: $("#host").val(), + username: $("#username").val(), + password: $("#password").val(), + ignore_cert_errors: $("#ignore_cert_errors").prop("checked") + } + } + btnHtml = $("#sendTestModalSubmit").html() + $("#sendTestModalSubmit").html(' Sending') + // Send the test email + api.send_test_email(test_email_request) + .success(function(data) { + $("#sendTestEmailModal\\.flashes").empty().append("
\ + Email Sent!
") + $("#sendTestModalSubmit").html(btnHtml) + }) + .error(function(data) { + $("#sendTestEmailModal\\.flashes").empty().append("
\ + " + data.responseJSON.message + "
") + $("#sendTestModalSubmit").html(btnHtml) + }) +}*/ //disable sendTestEmail functionality on sending profile page until update handling of /util/send_test_email + // Save attempts to POST to /smtp/ function save(idx) { var profile = {} diff --git a/templates/sending_profiles.html b/templates/sending_profiles.html index b564a308..a7992b18 100644 --- a/templates/sending_profiles.html +++ b/templates/sending_profiles.html @@ -79,11 +79,11 @@
- +
- +
@@ -97,6 +97,8 @@
+ + + + + + + {{end}} {{define "scripts"}}