Subversion Repositories SmartDukaan

Rev

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

Rev 20552 Rev 20558
Line 88... Line 88...
88
	private String state;
88
	private String state;
89
	private String mobile;
89
	private String mobile;
90
	private String category;
90
	private String category;
91
	private String msg;
91
	private String msg;
92
	private String productName;
92
	private String productName;
-
 
93
	private String queryType;
-
 
94
 
-
 
95
	public String getQueryType() {
-
 
96
		return queryType;
-
 
97
	}
-
 
98
 
-
 
99
	public void setQueryType(String queryType) {
-
 
100
		this.queryType = queryType;
-
 
101
	}
93
 
102
 
94
	public String getProductName() {
103
	public String getProductName() {
95
		return productName;
104
		return productName;
96
	}
105
	}
97
 
106
 
Line 118... Line 127...
118
	}
127
	}
119
 
128
 
120
	public String create(){
129
	public String create(){
121
		try {
130
		try {
122
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
131
			String gRecaptchaResponse = request.getParameter("g-recaptcha-response");
-
 
132
			StringBuilder sb = new StringBuilder();
-
 
133
			String subject ="";
-
 
134
			//String mailTo ="wecare@spicehotspot.co.in";
-
 
135
			String mailTo ="kshitij.sood@saholic.com";
123
			try{
136
			try{
-
 
137
				if (queryType.equalsIgnoreCase("generalQuery")){
-
 
138
					subject = "General Query";
-
 
139
					sb.append("Name : "+name);
-
 
140
					sb.append("Customer Email : "+email);
-
 
141
					sb.append("City : "+city);
-
 
142
					sb.append("State : "+state);
-
 
143
					sb.append("Phone : "+mobile);
-
 
144
					sb.append("Category : "+category);
-
 
145
					sb.append("Message : "+msg);
-
 
146
				}
-
 
147
				else if (queryType.equalsIgnoreCase("generalQuery")){
-
 
148
					JSONObject hotspotEntity = Mongo.getHotspotEntity(Long.valueOf(eid));
-
 
149
					productName = hotspotEntity.getString("title");
-
 
150
					subject = "Product Query - " +productName;
-
 
151
					sb.append("Name : "+name);
-
 
152
					sb.append("Product Name : "+productName);
-
 
153
					sb.append("Customer Email : "+email);
-
 
154
					sb.append("City : "+city);
-
 
155
					sb.append("State : "+state);
-
 
156
					sb.append("Phone : "+mobile);
-
 
157
					sb.append("Category : "+category);
-
 
158
					sb.append("Message : "+msg);
-
 
159
				}
124
				SendGridMail.sendMail();
160
				SendGridMail.sendMail(mailTo, subject, sb.toString());
125
			}
161
			}
126
			catch(Exception e){
162
			catch(Exception e){
127
				setResult("OOPS!!!We are unable to process your request.");
163
				setResult("OOPS!!!We are unable to process your request.");
128
				return "index";
164
				return "index";
129
			}
165
			}