Rev 20540 | Rev 20550 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.hotspotstore.controllers;import java.io.IOException;import com.hotspotstore.services.SendGridMail;import com.hotspotstore.services.VerifyRecaptcha;public class ContactUsController extends BaseController{/****/private static final long serialVersionUID = 1L;private String result;private String name;public String getName() {return name;}public void setName(String name) {this.name = name;}public String getEmail() {return email;}public void setEmail(String email) {this.email = email;}public String getCity() {return city;}public void setCity(String city) {this.city = city;}public String getState() {return state;}public void setState(String state) {this.state = state;}public String getMobile() {return mobile;}public void setMobile(String mobile) {this.mobile = mobile;}public String getCategory() {return category;}public void setCategory(String category) {this.category = category;}public String getMsg() {return msg;}public void setMsg(String msg) {this.msg = msg;}private String email;private String city;private String state;private String mobile;private String category;private String msg;public String getResult() {return result;}public void setResult(String result) {this.result = result;}public String index(){return "index";}public String create(){try {String gRecaptchaResponse = request.getParameter("g-recaptcha-response");try{SendGridMail.sendMail();}catch(Exception e){setResult("OOPS!!!We are unable to process your request.");return "index";}boolean verify = VerifyRecaptcha.verify(gRecaptchaResponse);if (verify){setResult("Thank you, your query has been submitted.");return "index";}setResult("Captcha verification failed.");} catch (IOException e) {System.out.println(e);setResult("OOPS!!!We are unable to process your request.");}return "index";}}