Subversion Repositories SmartDukaan

Rev

Rev 20530 | Rev 20535 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20530 Rev 20531
Line 1... Line 1...
1
package com.hotspotstore.controllers;
1
package com.hotspotstore.controllers;
2
 
2
 
3
import java.io.IOException;
3
import java.io.IOException;
4
 
4
 
-
 
5
import com.hotspotstore.services.SendGridMail;
5
import com.hotspotstore.services.VerifyRecaptcha;
6
import com.hotspotstore.services.VerifyRecaptcha;
6
 
7
 
7
 
8
 
8
public class ContactUsController extends BaseController{
9
public class ContactUsController extends BaseController{
9
 
10
 
10
	/**
11
	/**
11
	 * 
12
	 * 
12
	 */
13
	 */
13
	private static final long serialVersionUID = 1L;
14
	private static final long serialVersionUID = 1L;
14
	private String result;
15
	private String result;
-
 
16
	private String name;
-
 
17
	
-
 
18
	public String getName() {
-
 
19
		return name;
-
 
20
	}
-
 
21
 
-
 
22
	public void setName(String name) {
-
 
23
		this.name = name;
-
 
24
	}
-
 
25
 
-
 
26
	public String getEmail() {
-
 
27
		return email;
-
 
28
	}
-
 
29
 
-
 
30
	public void setEmail(String email) {
-
 
31
		this.email = email;
-
 
32
	}
-
 
33
 
-
 
34
	public String getCity() {
-
 
35
		return city;
-
 
36
	}
-
 
37
 
-
 
38
	public void setCity(String city) {
-
 
39
		this.city = city;
-
 
40
	}
-
 
41
 
-
 
42
	public String getState() {
-
 
43
		return state;
-
 
44
	}
-
 
45
 
-
 
46
	public void setState(String state) {
-
 
47
		this.state = state;
-
 
48
	}
-
 
49
 
-
 
50
	public String getMobile() {
-
 
51
		return mobile;
-
 
52
	}
-
 
53
 
-
 
54
	public void setMobile(String mobile) {
-
 
55
		this.mobile = mobile;
-
 
56
	}
-
 
57
 
-
 
58
	public String getCategory() {
-
 
59
		return category;
-
 
60
	}
-
 
61
 
-
 
62
	public void setCategory(String category) {
-
 
63
		this.category = category;
-
 
64
	}
-
 
65
 
-
 
66
	public String getMsg() {
-
 
67
		return msg;
-
 
68
	}
-
 
69
 
-
 
70
	public void setMsg(String msg) {
-
 
71
		this.msg = msg;
-
 
72
	}
-
 
73
 
-
 
74
	private String email;
-
 
75
	private String city;
-
 
76
	private String state;
-
 
77
	private String mobile;
15
	private String gRecaptchaResponse;
78
	private String category;
-
 
79
	private String msg;
16
 
80
 
17
	public String getResult() {
81
	public String getResult() {
18
		return result;
82
		return result;
19
	}
83
	}
20
 
84
 
Line 28... Line 92...
28
	
92
	
29
	public String create(){
93
	public String create(){
30
		try {
94
		try {
31
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
95
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
32
			boolean verify = VerifyRecaptcha.verify(gRecaptchaResponse);
96
			boolean verify = VerifyRecaptcha.verify(gRecaptchaResponse);
-
 
97
			SendGridMail.sendMail();
33
			if (verify){
98
			if (verify){
-
 
99
				
34
				return "contact-us-success";
100
				return "contact-us-success";
35
			}
101
			}
36
			return "contact-us-failure";
102
			return "contact-us-failure";
37
			
103
			
38
		} catch (IOException e) {
104
		} catch (IOException e) {