Subversion Repositories SmartDukaan

Rev

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

Rev 17082 Rev 17197
Line 189... Line 189...
189
        }
189
        }
190
        
190
        
191
 
191
 
192
        crmServiceClient = new CRMClient().getClient();
192
        crmServiceClient = new CRMClient().getClient();
193
        activityId = String.valueOf(crmServiceClient.insertActivity(activity));
193
        activityId = String.valueOf(crmServiceClient.insertActivity(activity));
-
 
194
        if(isProfitMandiAgent()){
194
        try{
195
	        try{
195
	        if (ActivityType.RECEIVED_CALL_FROM_CUSTOMER.equals(ActivityType.valueOf(type))) {
196
		        if (ActivityType.RECEIVED_CALL_FROM_CUSTOMER.equals(ActivityType.valueOf(type))) {
196
	        	
197
		        	
197
	        	if(commonDescription==null || commonDescription.isEmpty()){
198
		        	if(commonDescription==null || commonDescription.isEmpty()){
198
	        		commonDescription = "Received Call From Customer || Email Id- ";
199
		        		commonDescription = "Received Call From Customer || Email Id- ";
199
	        		if (customerEmailId != null && !customerEmailId.isEmpty()) {
200
		        		if (customerEmailId != null && !customerEmailId.isEmpty()) {
200
	        			commonDescription = commonDescription+customerEmailId;
201
		        			commonDescription = commonDescription+customerEmailId;
201
	        		}
202
		        		}
202
	        		if(customerMobileNumber != null
203
		        		if(customerMobileNumber != null
203
	                        && !customerMobileNumber.isEmpty()) {
204
		                        && !customerMobileNumber.isEmpty()) {
204
	        			commonDescription = commonDescription+" & Mobile No:- "+customerMobileNumber;
205
		        			commonDescription = commonDescription+" & Mobile No:- "+customerMobileNumber;
205
	        		}
206
		        		}
206
	        	}else{
207
		        	}else{
207
	        		if (customerEmailId != null && !customerEmailId.isEmpty()) {
208
		        		if (customerEmailId != null && !customerEmailId.isEmpty()) {
208
	        			commonDescription = commonDescription+" || Email Id:- "+customerEmailId;
209
		        			commonDescription = commonDescription+" || Email Id:- "+customerEmailId;
209
	        		}
210
		        		}
210
	        		if(customerMobileNumber != null
211
		        		if(customerMobileNumber != null
211
	                        && !customerMobileNumber.isEmpty()) {
212
		                        && !customerMobileNumber.isEmpty()) {
212
	        			commonDescription = commonDescription+" & Mobile No:- "+customerMobileNumber;
213
		        			commonDescription = commonDescription+" & Mobile No:- "+customerMobileNumber;
213
	        		}
214
		        		}
214
	        	}
215
		        	}
-
 
216
		        	commonDescription = "PM Ticket: "+ commonDescription;
215
	        	sendMailtoManagersUsingGmailUtils(commonDescription, addTo, description);
217
		        	sendMailtoManagersUsingGmailUtils(commonDescription, addTo, description);
-
 
218
		        }
216
	        }
219
	        }
-
 
220
		    catch(Exception e){
-
 
221
		    	e.printStackTrace();
-
 
222
		    	try{
-
 
223
		    		sendMailToManagers(commonDescription, addTo, description);
-
 
224
		    	}
-
 
225
		    	catch(Exception e1){
-
 
226
		    		e1.printStackTrace();
-
 
227
		    	}
-
 
228
		    }
217
        }
229
        }
218
	    catch(Exception e){
-
 
219
	    	e.printStackTrace();
-
 
220
	    	try{
-
 
221
	    		sendMailToManagers(commonDescription, addTo, description);
-
 
222
	    	}
-
 
223
	    	catch(Exception e1){
-
 
224
	    		e1.printStackTrace();
-
 
225
	    	}
-
 
226
	    }
-
 
227
 
230
 
228
        return index();
231
        return index();
229
    }
232
    }
230
    
233
    
231
    private void sendMailToManagers(String subject, String[] addTo, String body) throws SendGridException{
234
    private void sendMailToManagers(String subject, String[] addTo, String body) throws SendGridException{