ether / ep_email_notifications

Subscribe to a pad and recieve an email when someone edits your pad
Apache License 2.0
10 stars 14 forks source link

Subscription confirmation page links to wrong URL #28

Closed froiloc closed 3 years ago

froiloc commented 9 years ago

Hi,

while testing the plugin I realized that the templates/response.ejs has a link to the pad that is subscribed. But this link doesn't use the correct URL if the URL has been customized or we use a proxy.

Nevertheless this is no problem, because in the settings there is the correct path to the pad in the attribute urlToPads.

So I propose a simple patch:

--- index.js.old        2015-06-25 12:55:13.000000000 +0200
+++ index.js    2015-06-29 16:24:25.992173034 +0200
@@ -15,7 +15,7 @@
     var param = path[3].split("=");
     var action = param[0];
     var actionId = param[1];
\-    var padURL = req.protocol + "://" + req.get('host') + "/p/" +padId;
\+    var padURL = (settings.ep_email_notifications.urlToPads?settings.ep_email_notifications.urlToPads:req.protocol + "://" + req.get('host') + "/p/") +padId;

     async.waterfall(
       [

https://zerobin.net/?4c2b4307844c9c99#9lBQNjdzb4W7oerhtHz+YyCAIQQ2U7v8wmPSi5DWC6Y=

This will use the settings if available, else it will construct the URL.

Maybe this can be used in a future release. Thanks.

JohnMcLear commented 9 years ago

Send through a pull request and I will take a look :)

JohnMcLear commented 3 years ago

Should be fixed now :)