Subversion Repositories SmartDukaan

Rev

Rev 35360 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
35337 aman 1
package com.spice.profitmandi.dao.service;
2
 
3
import com.spice.profitmandi.common.util.Utils;
4
import com.spice.profitmandi.dao.entity.fofo.TrialForm;
5
import com.spice.profitmandi.dao.service.loiForm.LoiFormServiceImpl;
6
import org.apache.logging.log4j.LogManager;
7
import org.apache.logging.log4j.Logger;
8
import org.springframework.beans.factory.annotation.Autowired;
9
import org.springframework.mail.javamail.JavaMailSender;
10
import org.springframework.stereotype.Service;
11
 
12
@Service
13
public class TrialServiceImpl implements TrialService{
14
 
15
    private static final Logger LOGGER = LogManager.getLogger(LoiFormServiceImpl.class);
16
 
17
    @Autowired
18
    JavaMailSender mailSender;
19
 
20
    @Override
21
    public void sentMailForTrialUser(TrialForm trialForm) throws Exception {
22
        String body =
23
                "Dear Team,\n\n" +
24
                        "A new trial registration has been received. Below are the submitted details:\n\n" +
25
                        "Applicant Name: " + trialForm.getFirstName() + " " + trialForm.getLastName() + "\n" +
26
                        "Business Name: " + trialForm.getBusinessName() + "\n" +
27
                        "Mobile: " + trialForm.getMobile() + "\n" +
28
                        "Email: " + trialForm.getEmail() + "\n" +
29
                        "GST Number: " + trialForm.getGstNumber() + "\n\n" +
30
                        "Address:\n" +
31
                        trialForm.getAddressLine1() + "\n" +
32
                        (trialForm.getAddressLine2() != null ? trialForm.getAddressLine2() + "\n" : "") +
33
                        trialForm.getCity() + ", " + trialForm.getState() + " - " + trialForm.getPincode() + "\n\n" +
34
 
35
                        "Please review the documents (PAN, Aadhaar, GST) and proceed with the next steps as required.\n\n";
36
        String[] emailTo = {"manish.gupta1@smartdukaan.com"};
37
//        String[] emailTo = {"aman.gupta@smartdukaan.com"};
38
        String[] cc = {"sm@smartdukaan.com", "gaurav.sharma@smartdukaan.com","tarun.verma@smartdukaan.com"};
39
        LOGGER.info("RegistrationBody - " + body);
40
        Utils.sendMailWithAttachments(mailSender, emailTo, cc,  "New Trial Registration: "  + trialForm.getBusinessName(), body);
41
 
42
 
43
    }
44
}