From aeb44eb8caab2f2cda4839eb8319e77e5ab9cce2 Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 31 Jan 2013 21:30:48 +0000 Subject: [PATCH] make email server an obj --- README.md | 6 +++--- static/js/ep_email.js | 2 +- update.js | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f7376ae..ce5f219 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ Open that pad in ANOTHER BROWSER then begin modifying, you should recieve an ema fromName: "Etherpad SETTINGS FILE!", fromEmail: "pad@etherpad.org", urlToPads: "http://beta.etherpad.org/p/", // urlToPads = The URL to your pads note the trailing / - smtpHostname: "127.0.0.1" + emailServer: { // See https://github.com/eleith/emailjs for settings + host: "127.0.0.1" + } } ``` @@ -23,8 +25,6 @@ Open that pad in ANOTHER BROWSER then begin modifying, you should recieve an ema * stop the ui prompting if already subscribed * Clean up all code * Stop it emailing me if I'm already on the pad -* Re-enable the pop up -* Allow for various SMTP auth / connectivity types # FUTURE VERSIONS TODO * v2 - Get the modified contents from the API HTML diff and append that to the Email and make the email from the server HTML not plain text diff --git a/static/js/ep_email.js b/static/js/ep_email.js index 094e99d..593d99d 100644 --- a/static/js/ep_email.js +++ b/static/js/ep_email.js @@ -28,7 +28,7 @@ function init(){ if(clientHasAlreadyRegistered()){ // if the client has already registered for emails on this pad. // showAlreadyRegistered(); // client has already registered, let em know.. }else{ - // askClientToEnterEmail(); // ask the client to register TODO uncomment me for a pop up + askClientToEnterEmail(); // ask the client to register TODO uncomment me for a pop up } } } diff --git a/update.js b/update.js index ab1a328..158ac67 100644 --- a/update.js +++ b/update.js @@ -13,15 +13,13 @@ var staleTime = pluginSettings.staleTime || 30000; var fromName = pluginSettings.fromName || "Etherpad"; var fromEmail = pluginSettings.fromEmail || "pad@etherpad.org"; var urlToPads = pluginSettings.urlToPads || "http://beta.etherpad.org/p/"; -var smtpHostname = pluginSettings.smtpHostname || "127.0.0.1"; +var emailServer = pluginSettings.emailServer || {host:"127.0.0.1"}; // A timer object we maintain to control how we send emails var timers = {}; // Connect to the email server -var server = email.server.connect({ - host: smtpHostname, -}); +var server = email.server.connect(emailServer); exports.padUpdate = function (hook_name, _pad) { var pad = _pad.pad;