Subversion Repositories SmartDukaan

Rev

Rev 36008 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36008 Rev 36399
Line 23... Line 23...
23
public class TrialServiceImpl implements TrialService {
23
public class TrialServiceImpl implements TrialService {
24
 
24
 
25
    private static final Logger LOGGER = LogManager.getLogger(LoiFormServiceImpl.class);
25
    private static final Logger LOGGER = LogManager.getLogger(LoiFormServiceImpl.class);
26
 
26
 
27
    @Autowired
27
    @Autowired
28
    JavaMailSender mailSender;
28
    JavaMailSender gmailRelaySender;
29
 
29
 
30
    @Autowired
30
    @Autowired
31
    AuthRepository authRepository;
31
    AuthRepository authRepository;
32
 
32
 
33
    @Autowired
33
    @Autowired
Line 59... Line 59...
59
 
59
 
60
        String[] emailTo = {"kamini.sharma@smartdukaan.com"};
60
        String[] emailTo = {"kamini.sharma@smartdukaan.com"};
61
//        String[] emailTo = {"aman.gupta@smartdukaan.com"};
61
//        String[] emailTo = {"aman.gupta@smartdukaan.com"};
62
        String[] cc = {"vaibhav.tandon@smartdukaan.com", "tarun.verma@smartdukaan.com"};
62
        String[] cc = {"vaibhav.tandon@smartdukaan.com", "tarun.verma@smartdukaan.com"};
63
        LOGGER.info("RegistrationBody - " + body);
63
        LOGGER.info("RegistrationBody - " + body);
64
        emailService.sendMailWithAttachments(mailSender, emailTo, cc, "New Trial Registration: " + trialForm.getBusinessName(), body);
64
        emailService.sendMailWithAttachments(gmailRelaySender, emailTo, cc, "New Trial Registration: " + trialForm.getBusinessName(), body);
65
 
65
 
66
 
66
 
67
    }
67
    }
68
 
68
 
69
    public void sentMailToTrialUser(TrialForm trialForm) throws Exception {
69
    public void sentMailToTrialUser(TrialForm trialForm) throws Exception {
Line 99... Line 99...
99
 
99
 
100
        String[] emailTo = {trialForm.getEmail()};
100
        String[] emailTo = {trialForm.getEmail()};
101
        String[] cc = {"sdtech@smartdukaan.com"}; // tarun.verma@smartdukaan.com
101
        String[] cc = {"sdtech@smartdukaan.com"}; // tarun.verma@smartdukaan.com
102
        LOGGER.info("RegistrationBody - " + body);
102
        LOGGER.info("RegistrationBody - " + body);
103
        emailService.sendMailWithAttachments(
103
        emailService.sendMailWithAttachments(
104
                mailSender,
104
                gmailRelaySender,
105
                emailTo,
105
                emailTo,
106
                cc,
106
                cc,
107
                "Application Received - Verification in Progress",
107
                "Application Received - Verification in Progress",
108
                body
108
                body
109
        );
109
        );
Line 148... Line 148...
148
        String[] cc = ccList.stream()
148
        String[] cc = ccList.stream()
149
                .filter(email -> !email.trim().isEmpty())
149
                .filter(email -> !email.trim().isEmpty())
150
                .toArray(String[]::new);
150
                .toArray(String[]::new);
151
        LOGGER.info("RegistrationBody - " + body);
151
        LOGGER.info("RegistrationBody - " + body);
152
        LOGGER.info("cc list - " + Arrays.toString(cc));
152
        LOGGER.info("cc list - " + Arrays.toString(cc));
153
        emailService.sendMailWithAttachments(mailSender, emailTo, cc, "NEW LEAD ASSIGNED: " + trialForm.getBusinessName() + "- Call/Visit ASAP", body);
153
        emailService.sendMailWithAttachments(gmailRelaySender, emailTo, cc, "NEW LEAD ASSIGNED: " + trialForm.getBusinessName() + "- Call/Visit ASAP", body);
154
 
154
 
155
 
155
 
156
    }
156
    }
157
 
157
 
158
    public void sentMailForStoreCodeCreation(TrialForm trialForm) throws Exception {
158
    public void sentMailForStoreCodeCreation(TrialForm trialForm) throws Exception {
Line 164... Line 164...
164
 
164
 
165
        String[] emailTo = {"gaurav.sharma@smartdukaan.com"};
165
        String[] emailTo = {"gaurav.sharma@smartdukaan.com"};
166
        LOGGER.info("RegistrationBody - " + body);
166
        LOGGER.info("RegistrationBody - " + body);
167
        String[] cc = {"devkinandan.lal@smartdukaan.com", "tarun.verma@smartdukaan.com"};
167
        String[] cc = {"devkinandan.lal@smartdukaan.com", "tarun.verma@smartdukaan.com"};
168
        LOGGER.info("cc list - " + Arrays.toString(cc));
168
        LOGGER.info("cc list - " + Arrays.toString(cc));
169
        emailService.sendMailWithAttachments(mailSender, emailTo, cc, "Store Code Creation Required for trial user" + trialForm.getBusinessName(), body);
169
        emailService.sendMailWithAttachments(gmailRelaySender, emailTo, cc, "Store Code Creation Required for trial user" + trialForm.getBusinessName(), body);
170
 
170
 
171
 
171
 
172
    }
172
    }
173
 
173
 
174
    public void sentRejectionMailToTrialUser(TrialForm trialForm) throws Exception {
174
    public void sentRejectionMailToTrialUser(TrialForm trialForm) throws Exception {
Line 195... Line 195...
195
 
195
 
196
        String[] emailTo = {trialForm.getEmail()};
196
        String[] emailTo = {trialForm.getEmail()};
197
        String[] cc = {"sdtech@smartdukaan.com"};
197
        String[] cc = {"sdtech@smartdukaan.com"};
198
 
198
 
199
        emailService.sendMailWithAttachments(
199
        emailService.sendMailWithAttachments(
200
                mailSender,
200
                gmailRelaySender,
201
                emailTo,
201
                emailTo,
202
                cc,
202
                cc,
203
                "Update on Your SmartDukaan Free Trial Request",
203
                "Update on Your SmartDukaan Free Trial Request",
204
                body
204
                body
205
        );
205
        );
Line 226... Line 226...
226
 
226
 
227
        String[] emailTo = {trialForm.getEmail()};
227
        String[] emailTo = {trialForm.getEmail()};
228
        String[] cc = {"sdtech@smartdukaan.com"};
228
        String[] cc = {"sdtech@smartdukaan.com"};
229
 
229
 
230
        emailService.sendMailWithAttachments(
230
        emailService.sendMailWithAttachments(
231
                mailSender,
231
                gmailRelaySender,
232
                emailTo,
232
                emailTo,
233
                cc,
233
                cc,
234
                "We’ve Received Your Interest in the SmartDukaan Franchise",
234
                "We’ve Received Your Interest in the SmartDukaan Franchise",
235
                body
235
                body
236
        );
236
        );
Line 273... Line 273...
273
        ccList.add("tarun.verma@smartdukaan.com");
273
        ccList.add("tarun.verma@smartdukaan.com");
274
        String[] cc = ccList.stream()
274
        String[] cc = ccList.stream()
275
                .filter(email -> !email.trim().isEmpty())
275
                .filter(email -> !email.trim().isEmpty())
276
                .toArray(String[]::new);
276
                .toArray(String[]::new);
277
        emailService.sendMailWithAttachments(
277
        emailService.sendMailWithAttachments(
278
                mailSender,
278
                gmailRelaySender,
279
                emailTo,
279
                emailTo,
280
                cc,
280
                cc,
281
                "Franchise Upgrade Request - " + applicantName + ", " + trialForm.getBusinessName(),
281
                "Franchise Upgrade Request - " + applicantName + ", " + trialForm.getBusinessName(),
282
                body
282
                body
283
        );
283
        );