From 4f35305b0afcbabb896a5434002baa8772f14b7a Mon Sep 17 00:00:00 2001 From: Nedim Uka Date: Mon, 29 Jul 2019 13:04:25 +0200 Subject: [PATCH 1/2] Show only 10 realestates in notificatio email --- app/helpers/awsEmail.js | 11 +++++++---- development.env | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/helpers/awsEmail.js b/app/helpers/awsEmail.js index f5f3c70..d99259e 100644 --- a/app/helpers/awsEmail.js +++ b/app/helpers/awsEmail.js @@ -4,7 +4,8 @@ const { getRealEstateTypeEnum } = require('./enums'); const { getRegionName, getMunicipalityName } = require('./codes'); const { allRERequestByUiid } = require('./db/dbHelper'); var AWS = require('aws-sdk'); -const TEMPLATE_NAME = "MarketAlertTemplate" +const TEMPLATE_NAME = process.env.AMAZON_NOTIFICATION_EMAIL_TEMPLATE; +const NUMBER_OF_RESULTS_TO_SHOW=10; AWS.config.update({ region: process.env.AMAZON_REGION, @@ -100,9 +101,7 @@ const sendBulkEmail = async (marketAlerts) => { destinations = [] groupedRERequests = []; - const RERequestUuidsMaped = marketAlerts.map(marketAlert => marketAlert.request); - const RERequestUuidsArray = Array.from(new Set(RERequestUuidsMaped)); const RERequestUuids = RERequestUuidsArray.map(marketAlert => { @@ -196,9 +195,13 @@ const sendBulkEmail = async (marketAlerts) => { const toAWSArray = (urlArray) => { let arrayString = "" + i = 0 urlArray.forEach(element => { const formatetdTitle = element.title.replace(/"/g, ""); - arrayString = arrayString + `{"url":"${element.url.trim()}" , "title":"${formatetdTitle}"},` + arrayString = i <= NUMBER_OF_RESULTS_TO_SHOW ? arrayString + `{"url":"${element.url.trim()}" , "title":"${formatetdTitle}"},` : arrayString; + console.log(i); + console.log(arrayString); + i++ }); return arrayString.slice(0, -1); diff --git a/development.env b/development.env index 3980ba3..f6370e4 100644 --- a/development.env +++ b/development.env @@ -1,5 +1,6 @@ AMAZON_ACCES_KEY_ID=(your-key-here) AMAZON_SECRET_ACCESS_KEY=(your-key-here) AMAZON_REGION=eu-west-1 + AMAZON_NOTIFICATION_EMAIL_TEMPLATE=MarketAlertTemplateDevelopment APP_URL=http://localhost:3001 SOURCE_EMAIL=info@saburly.com \ No newline at end of file -- 2.47.3 From a45722620752c5d5342ad4f273e41c73a2869c54 Mon Sep 17 00:00:00 2001 From: Nedim Uka Date: Mon, 29 Jul 2019 14:39:31 +0200 Subject: [PATCH 2/2] Fixed margin for navbar --- app/controllers/welcome.js | 2 +- app/public/main.css | 5 +---- app/views/gardenSize.ejs | 2 -- app/views/goAgain.ejs | 2 -- app/views/layout.ejs | 2 ++ app/views/municipality.ejs | 2 -- app/views/neighborhoodMap.ejs | 2 -- app/views/price.ejs | 2 -- app/views/queryReview.ejs | 2 -- app/views/querySubmit.ejs | 3 --- app/views/realEstateType.ejs | 2 -- app/views/realEstates.ejs | 2 -- app/views/region.ejs | 2 -- app/views/size.ejs | 2 -- app/views/unsubscribe.ejs | 1 - 15 files changed, 4 insertions(+), 29 deletions(-) diff --git a/app/controllers/welcome.js b/app/controllers/welcome.js index 258b551..32fdf07 100644 --- a/app/controllers/welcome.js +++ b/app/controllers/welcome.js @@ -1,5 +1,5 @@ const getWelcome = (req,res) => { - const title = "Koju nekretninu tražite?" + const title = "" res.render('welcome', { nextStep: '/vrstanekretnine', title } ); }; diff --git a/app/public/main.css b/app/public/main.css index b936827..28508e1 100644 --- a/app/public/main.css +++ b/app/public/main.css @@ -23,7 +23,6 @@ margin-top: 200px; } - .centered-element-small { margin-top: 100px; } @@ -36,9 +35,7 @@ html, body { height: 100%; - margin: 0; - padding: 0; - font-family: 'Tangerine', serif; + } #floating-panel { diff --git a/app/views/gardenSize.ejs b/app/views/gardenSize.ejs index c0c1b91..bcbec2d 100644 --- a/app/views/gardenSize.ejs +++ b/app/views/gardenSize.ejs @@ -1,4 +1,2 @@ -<% include partials/navBar %> - <% include partials/range %> diff --git a/app/views/goAgain.ejs b/app/views/goAgain.ejs index 1040e96..d0ae80b 100644 --- a/app/views/goAgain.ejs +++ b/app/views/goAgain.ejs @@ -1,6 +1,4 @@ -<% include partials/navBar %> -
diff --git a/app/views/layout.ejs b/app/views/layout.ejs index 2dad9cc..eb876c6 100644 --- a/app/views/layout.ejs +++ b/app/views/layout.ejs @@ -12,7 +12,9 @@ + <% include partials/navBar %>
+ <%-body%>
diff --git a/app/views/municipality.ejs b/app/views/municipality.ejs index aae8813..8c972de 100644 --- a/app/views/municipality.ejs +++ b/app/views/municipality.ejs @@ -1,6 +1,4 @@ -<% include partials/navBar %> -
    diff --git a/app/views/neighborhoodMap.ejs b/app/views/neighborhoodMap.ejs index e8cf5fd..93bcfd2 100644 --- a/app/views/neighborhoodMap.ejs +++ b/app/views/neighborhoodMap.ejs @@ -1,5 +1,3 @@ -<% include partials/navBar %> -
    diff --git a/app/views/price.ejs b/app/views/price.ejs index c0c1b91..bcbec2d 100644 --- a/app/views/price.ejs +++ b/app/views/price.ejs @@ -1,4 +1,2 @@ -<% include partials/navBar %> - <% include partials/range %> diff --git a/app/views/queryReview.ejs b/app/views/queryReview.ejs index e8105b4..e342070 100644 --- a/app/views/queryReview.ejs +++ b/app/views/queryReview.ejs @@ -1,6 +1,4 @@ -<% include partials/navBar %> -
      diff --git a/app/views/querySubmit.ejs b/app/views/querySubmit.ejs index e608805..a97fe51 100644 --- a/app/views/querySubmit.ejs +++ b/app/views/querySubmit.ejs @@ -1,7 +1,4 @@ -<% include partials/navBar %> - -
      Da Vam javimo kada se Vaša željena nekretnina pojavi u oglasima, upišite vaš e-mail
      diff --git a/app/views/realEstateType.ejs b/app/views/realEstateType.ejs index eac9357..c5e44c4 100644 --- a/app/views/realEstateType.ejs +++ b/app/views/realEstateType.ejs @@ -1,6 +1,4 @@ -<% include partials/navBar %> -
        diff --git a/app/views/realEstates.ejs b/app/views/realEstates.ejs index 9dc5fb6..0e2731f 100644 --- a/app/views/realEstates.ejs +++ b/app/views/realEstates.ejs @@ -1,6 +1,4 @@ -<% include partials/navBar %> -
          <% for(const realEstate of realEstates) { %> diff --git a/app/views/region.ejs b/app/views/region.ejs index a5c4a40..42dd841 100644 --- a/app/views/region.ejs +++ b/app/views/region.ejs @@ -1,6 +1,4 @@ -<% include partials/navBar %> -
            diff --git a/app/views/size.ejs b/app/views/size.ejs index c0c1b91..bcbec2d 100644 --- a/app/views/size.ejs +++ b/app/views/size.ejs @@ -1,4 +1,2 @@ -<% include partials/navBar %> - <% include partials/range %> diff --git a/app/views/unsubscribe.ejs b/app/views/unsubscribe.ejs index c97f5b7..d11480a 100644 --- a/app/views/unsubscribe.ejs +++ b/app/views/unsubscribe.ejs @@ -1,5 +1,4 @@ -<% include partials/navBar %>
            -- 2.47.3