Browse Source

add caddyfile and change test in how its work page

Anton Kovalenko 2 years ago
parent
commit
3c1ecdaf1e
4 changed files with 54 additions and 20 deletions
  1. 28 0
      Caddyfile
  2. 1 1
      public/how-it-works.html
  3. 11 19
      public/js/custom.js
  4. 14 0
      template.txt

+ 28 - 0
Caddyfile View File

@@ -0,0 +1,28 @@
1
+http://veda-masters.com {
2
+    bind 0.0.0.0
3
+    gzip
4
+    root public
5
+    git {
6
+        repo ssh://git@docs.greenitglobe.com:10022/veda/www_veda-masters.com.git
7
+        branch master
8
+        interval 60
9
+        key  /root/.ssh/id_rsa
10
+        path /opt/www_veda-masters.com
11
+    }
12
+
13
+    mailout /www_veda-masters.com {
14
+       maillog     log/caddy-mailout.log
15
+       errorlog    log/caddy-mailout.log
16
+
17
+       to info@veda-masters.com
18
+       subject "Text Email from {{ .Form.Get \"name\" }}"
19
+       body template.txt
20
+
21
+       username "caddymail@greenitglobe.com"
22
+       password "xthhjouucnpcnhko"
23
+       host smtp.gmail.com
24
+       port 465
25
+       ratelimit_capacity 3
26
+       ratelimit_interval 6s
27
+   }
28
+}

+ 1 - 1
public/how-it-works.html View File

@@ -225,7 +225,7 @@
225 225
 				<div class="row">
226 226
 					<div class="four columns animated service-item" data-animate="fadeInLeft" data-animate-delay="300">
227 227
 						<img src="images/icons_retreats/yoga.svg" alt="Yoga, Meditation, Massage">
228
-						<h5>Yoga, Meditation, Massage</h5>
228
+						<h5>Yoga, Meditation, Massage at Request</h5>
229 229
 					</div>
230 230
 					<div class="four columns animated service-item" data-animate="fadeIn" data-animate-delay="300">
231 231
             <img src="images/icons_retreats/organic_food.svg" alt="Organic Healthy Food">

+ 11 - 19
public/js/custom.js View File

@@ -455,34 +455,26 @@ $(document).ready(function ($) {
455 455
     } else if (!email_compare.test(email)) {
456 456
       $('#error-valid-email').fadeIn('slow');
457 457
       return false;
458
-
459
-    } else if (!phone_compare.test(phone)) {
460
-      $('#error-valid-phone').fadeIn('slow');
461
-      return false;
462 458
     }
459
+    // } else if (!phone_compare.test(phone)) {
460
+    //   $('#error-valid-phone').fadeIn('slow');
461
+    //   return false;
462
+    // }
463 463
 
464 464
     var data_string = $('#contact-us').serialize();
465 465
 
466
-    $.ajax({
466
+    return $.ajax({
467 467
       type: "POST",
468
-      url: $('#contact-us').attr('action'),
468
+      url: 'http://veda-masters.com/www_veda-masters.com',
469 469
       data: data_string,
470
-      timeout: 6000,
471
-      error: function(request,error) {
472
-        if (error == "timeout") {
473
-          $('#error-timedout').slideDown('slow');
474
-        }
475
-        else {
476
-          $('#error-state').slideDown('slow');
477
-        }
470
+      timeout: 6e3,
471
+      error: function(request, error) {
472
+        "timeout" == error ? $("#error-timedout").slideDown("slow") : $("#error-state").slideDown("slow")
478 473
       },
479 474
       success: function() {
480
-        $('#email-success').slideDown('slow');
481
-        $("#contact-us").trigger('reset');
475
+        $("#email-success").slideDown("slow"), $("#contact-us").trigger("reset")
482 476
       }
483
-    });
484
-
485
-    return false;
477
+    }), !1
486 478
   });
487 479
 });
488 480
 

+ 14 - 0
template.txt View File

@@ -0,0 +1,14 @@
1
+Hello,
2
+
3
+please find below a new contact:
4
+
5
+Name            {{.Form.Get "name"}}
6
+Email           {{.Form.Get "email"}}
7
+
8
+
9
+Message:
10
+{{.Form.Get "message"}}
11
+
12
+Best Regards,
13
+
14
+Veda Master Support