Background job for sending emails + confirmation email template.
This commit is contained in:
parent
a5605a0349
commit
001e7b59a3
13 changed files with 414 additions and 18 deletions
server/utils
39
server/utils/urlBuilder.js
Normal file
39
server/utils/urlBuilder.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('ffffng').factory('UrlBuilder', function (_, config) {
|
||||
function formUrl(route, queryParams) {
|
||||
var url = config.server.baseUrl;
|
||||
if (route || queryParams) {
|
||||
url += '/#!/';
|
||||
}
|
||||
if (route) {
|
||||
url += route;
|
||||
}
|
||||
if (queryParams) {
|
||||
url += '?';
|
||||
url += _.join(
|
||||
_.map(
|
||||
queryParams,
|
||||
function (value, key) {
|
||||
return encodeURIComponent(key) + '=' + encodeURIComponent(value);
|
||||
}
|
||||
),
|
||||
'&'
|
||||
);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
return {
|
||||
editNodeUrl: function () {
|
||||
return formUrl('update');
|
||||
},
|
||||
|
||||
monitoringConfirmUrl: function (node, nodeSecrets) {
|
||||
return formUrl('monitoring/confirm', { mac: node.mac, token: nodeSecrets.monitoringToken });
|
||||
},
|
||||
monitoringDisableUrl: function (node, nodeSecrets) {
|
||||
return formUrl('monitoring/disable', { mac: node.mac, token: nodeSecrets.monitoringToken });
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue