Subversion Repositories SmartDukaan

Rev

Rev 20530 | Rev 20535 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20427 kshitij.so 1
package com.hotspotstore.controllers;
2
 
20529 kshitij.so 3
import java.io.IOException;
4
 
20531 kshitij.so 5
import com.hotspotstore.services.SendGridMail;
20529 kshitij.so 6
import com.hotspotstore.services.VerifyRecaptcha;
20427 kshitij.so 7
 
8
 
9
public class ContactUsController extends BaseController{
10
 
11
	/**
12
	 * 
13
	 */
14
	private static final long serialVersionUID = 1L;
15
	private String result;
20531 kshitij.so 16
	private String name;
17
 
18
	public String getName() {
19
		return name;
20
	}
20427 kshitij.so 21
 
20531 kshitij.so 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;
78
	private String category;
79
	private String msg;
80
 
20427 kshitij.so 81
	public String getResult() {
82
		return result;
83
	}
84
 
85
	public void setResult(String result) {
86
		this.result = result;
87
	}
88
 
89
	public String index(){
90
		return "index";
91
	}
92
 
93
	public String create(){
20529 kshitij.so 94
		try {
20530 kshitij.so 95
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
20529 kshitij.so 96
			boolean verify = VerifyRecaptcha.verify(gRecaptchaResponse);
20531 kshitij.so 97
			SendGridMail.sendMail();
20529 kshitij.so 98
			if (verify){
20531 kshitij.so 99
 
20529 kshitij.so 100
				return "contact-us-success";
101
			}
102
			return "contact-us-failure";
103
 
104
		} catch (IOException e) {
105
			// TODO Auto-generated catch block
106
			return "contact-us-failure";
107
		}
108
 
20427 kshitij.so 109
	}
110
 
111
 
112
}