Subversion Repositories SmartDukaan

Rev

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

Rev 28293 Rev 28294
Line 730... Line 730...
730
		StringWriter writer = new StringWriter();
730
		StringWriter writer = new StringWriter();
731
		t.merge(context, writer);
731
		t.merge(context, writer);
732
 
732
 
733
		CustomRetailer customRetailer = retailerService.getFofoRetailer(pendingOrder.getFofoId());
733
		CustomRetailer customRetailer = retailerService.getFofoRetailer(pendingOrder.getFofoId());
734
		Customer customer = customerRepository.selectById(pendingOrder.getCustomerId());
734
		Customer customer = customerRepository.selectById(pendingOrder.getCustomerId());
735
		
735
 
736
		if (!customer.getEmailId().equals(null)) {
736
		if (!customer.getEmailId().equals(null)) {
737
			String[] customerEmail = { customer.getEmailId() };
737
			String[] customerEmail = { customer.getEmailId() };
738
 
738
 
739
			this.sendMailWithAttachments("Order Confirmation", writer.toString(), customerEmail);
739
			this.sendMailWithAttachments("Order Confirmation", writer.toString(), customerEmail);
740
 
740
 
Line 743... Line 743...
743
		String[] retailerEmail = { customRetailer.getEmail() };
743
		String[] retailerEmail = { customRetailer.getEmail() };
744
 
744
 
745
		List<String> sendTo = Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com",
745
		List<String> sendTo = Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com",
746
				"hemant.kaura@smartdukaan.com", "niranjan.kala@smartdukaan.com", "sm@smartdukaan.com",
746
				"hemant.kaura@smartdukaan.com", "niranjan.kala@smartdukaan.com", "sm@smartdukaan.com",
747
				"tejbeer.kaur@shop2020.in");
747
				"tejbeer.kaur@shop2020.in");
-
 
748
 
748
		List<String> authUserEmails = csService.getAuthUserByPartnerId(customRetailer.getPartnerId());
749
		List<String> authUserEmails = csService.getAuthUserByPartnerId(customRetailer.getPartnerId());
-
 
750
		logger.info("authUserEmails" + authUserEmails);
749
 
751
 
750
		this.sendMailWithAttachments("Order Confirmation", writer.toString(), retailerEmail);
752
		this.sendMailWithAttachments("Order Confirmation", writer.toString(), retailerEmail);
751
		this.sendMailWithAttachments("Order Confirmation", writer.toString(),
753
		this.sendMailWithAttachments("Order Confirmation", writer.toString(),
752
				sendTo.toArray(new String[sendTo.size()]));
754
				sendTo.toArray(new String[sendTo.size()]));
753
 
755
 
754
		if (!authUserEmails.isEmpty()) {
756
		if (!authUserEmails.isEmpty()) {
755
			this.sendMailWithAttachments("Order Confirmation", writer.toString(),
757
			this.sendMailWithAttachments("Order Confirmation", writer.toString(),
756
					authUserEmails.toArray(new String[sendTo.size()]));
758
					authUserEmails.toArray(new String[authUserEmails.size()]));
757
		}
759
		}
758
		return responseSender.ok(pendingOrder);
760
		return responseSender.ok(pendingOrder);
759
	}
761
	}
760
 
762
 
761
	private void sendMailWithAttachments(String subject, String messageText, String[] email) throws Exception {
763
	private void sendMailWithAttachments(String subject, String messageText, String[] email) throws Exception {