Subversion Repositories SmartDukaan

Rev

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

Rev 20535 Rev 20539
Line 12... Line 12...
12
	 * 
12
	 * 
13
	 */
13
	 */
14
	private static final long serialVersionUID = 1L;
14
	private static final long serialVersionUID = 1L;
15
	private String result;
15
	private String result;
16
	private String name;
16
	private String name;
17
	
17
 
18
	public String getName() {
18
	public String getName() {
19
		return name;
19
		return name;
20
	}
20
	}
21
 
21
 
22
	public void setName(String name) {
22
	public void setName(String name) {
Line 87... Line 87...
87
	}
87
	}
88
 
88
 
89
	public String index(){
89
	public String index(){
90
		return "index";
90
		return "index";
91
	}
91
	}
92
	
92
 
93
	public String create(){
93
	public String create(){
94
		try {
94
		try {
95
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
95
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
-
 
96
			try{
-
 
97
				SendGridMail.sendMail();
-
 
98
			}
-
 
99
			catch(Exception e){
-
 
100
				addActionError("OOPS!!!We are unable to process your request.");
-
 
101
				return "index";
-
 
102
			}
96
			boolean verify = VerifyRecaptcha.verify(gRecaptchaResponse);
103
			boolean verify = VerifyRecaptcha.verify(gRecaptchaResponse);
97
			SendGridMail.sendMail();
-
 
98
			if (verify){
104
			if (verify){
99
				
-
 
100
				return "contact-us-success";
105
				addActionMessage("Thank you, your query has been submitted.");
101
			}
106
			}
102
			return "contact-us-failure";
107
			addActionError("Captcha verification failed.");
103
			
108
 
104
		} catch (IOException e) {
109
		} catch (IOException e) {
105
			System.out.println(e);
110
			System.out.println(e);
106
			// TODO Auto-generated catch block
111
			addActionError("OOPS!!!We are unable to process your request.");
107
			return "contact-us-failure";
-
 
108
		}
112
		}
-
 
113
		return "index";
109
		
114
 
110
	}
115
	}
111
 
116
 
112
 
117
 
113
}
118
}
114
119