| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 3 |
import javax.mail.internet.InternetAddress;
|
3 |
import javax.mail.internet.InternetAddress;
|
| 4 |
import javax.mail.internet.MimeMessage;
|
4 |
import javax.mail.internet.MimeMessage;
|
| 5 |
import javax.servlet.http.HttpServletRequest;
|
5 |
import javax.servlet.http.HttpServletRequest;
|
| 6 |
|
6 |
|
| - |
|
7 |
import org.apache.logging.log4j.Logger;
|
| - |
|
8 |
import org.apache.logging.log4j.LogManager;
|
| 7 |
import org.springframework.beans.factory.annotation.Autowired;
|
9 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 8 |
import org.springframework.http.MediaType;
|
10 |
import org.springframework.http.MediaType;
|
| 9 |
import org.springframework.http.ResponseEntity;
|
11 |
import org.springframework.http.ResponseEntity;
|
| 10 |
import org.springframework.mail.javamail.JavaMailSender;
|
12 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 11 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
13 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
| Line 15... |
Line 17... |
| 15 |
import org.springframework.web.bind.annotation.RequestMapping;
|
17 |
import org.springframework.web.bind.annotation.RequestMapping;
|
| 16 |
import org.springframework.web.bind.annotation.RequestMethod;
|
18 |
import org.springframework.web.bind.annotation.RequestMethod;
|
| 17 |
|
19 |
|
| 18 |
import com.spice.profitmandi.common.model.UserInfo;
|
20 |
import com.spice.profitmandi.common.model.UserInfo;
|
| 19 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
21 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| - |
|
22 |
import com.spice.profitmandi.dao.config.WebDBContextConfigure;
|
| 20 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
23 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 21 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
24 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 22 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
25 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| 23 |
import com.spice.profitmandi.web.req.FeedbackRequest;
|
26 |
import com.spice.profitmandi.web.req.FeedbackRequest;
|
| 24 |
|
27 |
|
| Line 27... |
Line 30... |
| 27 |
|
30 |
|
| 28 |
@Controller
|
31 |
@Controller
|
| 29 |
@Transactional(rollbackFor=Throwable.class)
|
32 |
@Transactional(rollbackFor=Throwable.class)
|
| 30 |
public class ContactUsController {
|
33 |
public class ContactUsController {
|
| 31 |
|
34 |
|
| - |
|
35 |
|
| - |
|
36 |
private static final Logger LOGGER = LogManager.getLogger(ContactUsController.class);
|
| 32 |
@Autowired
|
37 |
@Autowired
|
| 33 |
private JavaMailSender mailSender;
|
38 |
private JavaMailSender mailSender;
|
| 34 |
|
39 |
|
| 35 |
@Autowired
|
40 |
@Autowired
|
| 36 |
private ResponseSender<?> responseSender;
|
41 |
private ResponseSender<?> responseSender;
|
| Line 63... |
Line 68... |
| 63 |
helper.setCc(cc);
|
68 |
helper.setCc(cc);
|
| 64 |
InternetAddress senderAddress = new InternetAddress("noreply@profitmandi.com", "ProfitMandi Admin");
|
69 |
InternetAddress senderAddress = new InternetAddress("noreply@profitmandi.com", "ProfitMandi Admin");
|
| 65 |
helper.setTo("help@profitmandi.com");
|
70 |
helper.setTo("help@profitmandi.com");
|
| 66 |
helper.setFrom(senderAddress);
|
71 |
helper.setFrom(senderAddress);
|
| 67 |
mailSender.send(message);
|
72 |
mailSender.send(message);
|
| 68 |
|
73 |
LOGGER.info("message send Successfully.....");
|
| 69 |
return responseSender.ok(true);
|
74 |
return responseSender.ok(true);
|
| 70 |
}
|
75 |
}
|
| 71 |
}
|
76 |
}
|