Subversion Repositories SmartDukaan

Rev

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

Rev 35499 Rev 35642
Line 1... Line 1...
1
package com.spice.profitmandi.dao.service;
1
package com.spice.profitmandi.dao.service;
2
 
2
 
3
import com.spice.profitmandi.common.model.ProfitMandiConstants;
3
import com.spice.profitmandi.common.model.ProfitMandiConstants;
4
import com.spice.profitmandi.common.util.Utils;
4
import com.spice.profitmandi.common.services.EmailService;
5
import com.spice.profitmandi.dao.entity.auth.AuthUser;
5
import com.spice.profitmandi.dao.entity.auth.AuthUser;
6
import com.spice.profitmandi.dao.entity.fofo.TrialForm;
6
import com.spice.profitmandi.dao.entity.fofo.TrialForm;
7
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
7
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
8
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
8
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
9
import com.spice.profitmandi.dao.repository.cs.CsService;
9
import com.spice.profitmandi.dao.repository.cs.CsService;
Line 31... Line 31...
31
    AuthRepository authRepository;
31
    AuthRepository authRepository;
32
 
32
 
33
    @Autowired
33
    @Autowired
34
    CsService csService;
34
    CsService csService;
35
 
35
 
-
 
36
    @Autowired
-
 
37
    EmailService emailService;
-
 
38
 
36
    @Override
39
    @Override
37
    public void sentMailForTrialUser(TrialForm trialForm) throws Exception {
40
    public void sentMailForTrialUser(TrialForm trialForm) throws Exception {
38
        String body =
41
        String body =
39
                "Dear Team,<br><br>" +
42
                "Dear Team,<br><br>" +
40
                        "A new partner has registered via the SmartDukaan Partners App. Please review the details below and initiate the verification process immediately.<br><br>" +
43
                        "A new partner has registered via the SmartDukaan Partners App. Please review the details below and initiate the verification process immediately.<br><br>" +
Line 56... Line 59...
56
 
59
 
57
        String[] emailTo = {"kamini.sharma@smartdukaan.com"};
60
        String[] emailTo = {"kamini.sharma@smartdukaan.com"};
58
//        String[] emailTo = {"aman.gupta@smartdukaan.com"};
61
//        String[] emailTo = {"aman.gupta@smartdukaan.com"};
59
        String[] cc = {"vaibhav.tandon@smartdukaan.com", "tarun.verma@smartdukaan.com"};
62
        String[] cc = {"vaibhav.tandon@smartdukaan.com", "tarun.verma@smartdukaan.com"};
60
        LOGGER.info("RegistrationBody - " + body);
63
        LOGGER.info("RegistrationBody - " + body);
61
        Utils.sendMailWithAttachments(mailSender, emailTo, cc, "New Trial Registration: " + trialForm.getBusinessName(), body);
64
        emailService.sendMailWithAttachments(mailSender, emailTo, cc, "New Trial Registration: " + trialForm.getBusinessName(), body);
62
 
65
 
63
 
66
 
64
    }
67
    }
65
 
68
 
66
    public void sentMailToTrialUser(TrialForm trialForm) throws Exception {
69
    public void sentMailToTrialUser(TrialForm trialForm) throws Exception {
Line 95... Line 98...
95
 
98
 
96
 
99
 
97
        String[] emailTo = {trialForm.getEmail()};
100
        String[] emailTo = {trialForm.getEmail()};
98
        String[] cc = {"tarun.verma@smartdukaan.com"};
101
        String[] cc = {"tarun.verma@smartdukaan.com"};
99
        LOGGER.info("RegistrationBody - " + body);
102
        LOGGER.info("RegistrationBody - " + body);
100
        Utils.sendMailWithAttachments(
103
        emailService.sendMailWithAttachments(
101
                mailSender,
104
                mailSender,
102
                emailTo,
105
                emailTo,
103
                cc,
106
                cc,
104
                "Application Received – Verification in Progress",
107
                "Application Received – Verification in Progress",
105
                body
108
                body
Line 145... Line 148...
145
        String[] cc = ccList.stream()
148
        String[] cc = ccList.stream()
146
                .filter(email -> !email.trim().isEmpty())
149
                .filter(email -> !email.trim().isEmpty())
147
                .toArray(String[]::new);
150
                .toArray(String[]::new);
148
        LOGGER.info("RegistrationBody - " + body);
151
        LOGGER.info("RegistrationBody - " + body);
149
        LOGGER.info("cc list - " + Arrays.toString(cc));
152
        LOGGER.info("cc list - " + Arrays.toString(cc));
150
        Utils.sendMailWithAttachments(mailSender, emailTo, cc, "NEW LEAD ASSIGNED: " + trialForm.getBusinessName() + "- Call/Visit ASAP", body);
153
        emailService.sendMailWithAttachments(mailSender, emailTo, cc, "NEW LEAD ASSIGNED: " + trialForm.getBusinessName() + "- Call/Visit ASAP", body);
151
 
154
 
152
 
155
 
153
    }
156
    }
154
 
157
 
155
    public void sentMailForStoreCodeCreation(TrialForm trialForm) throws Exception {
158
    public void sentMailForStoreCodeCreation(TrialForm trialForm) throws Exception {
Line 161... Line 164...
161
 
164
 
162
        String[] emailTo = {"gaurav.sharma@smartdukaan.com"};
165
        String[] emailTo = {"gaurav.sharma@smartdukaan.com"};
163
        LOGGER.info("RegistrationBody - " + body);
166
        LOGGER.info("RegistrationBody - " + body);
164
        String[] cc = {"devkinandan.lal@smartdukaan.com", "tarun.verma@smartdukaan.com"};
167
        String[] cc = {"devkinandan.lal@smartdukaan.com", "tarun.verma@smartdukaan.com"};
165
        LOGGER.info("cc list - " + Arrays.toString(cc));
168
        LOGGER.info("cc list - " + Arrays.toString(cc));
166
        Utils.sendMailWithAttachments(mailSender, emailTo, cc, "Store Code Creation Required for trial user" + trialForm.getBusinessName(), body);
169
        emailService.sendMailWithAttachments(mailSender, emailTo, cc, "Store Code Creation Required for trial user" + trialForm.getBusinessName(), body);
167
 
170
 
168
 
171
 
169
    }
172
    }
170
 
173
 
171
    public void sentRejectionMailToTrialUser(TrialForm trialForm) throws Exception {
174
    public void sentRejectionMailToTrialUser(TrialForm trialForm) throws Exception {
Line 191... Line 194...
191
 
194
 
192
 
195
 
193
        String[] emailTo = {trialForm.getEmail()};
196
        String[] emailTo = {trialForm.getEmail()};
194
        String[] cc = {"tarun.verma@smartdukaan.com"};
197
        String[] cc = {"tarun.verma@smartdukaan.com"};
195
 
198
 
196
        Utils.sendMailWithAttachments(
199
        emailService.sendMailWithAttachments(
197
                mailSender,
200
                mailSender,
198
                emailTo,
201
                emailTo,
199
                cc,
202
                cc,
200
                "Update on Your SmartDukaan Free Trial Request",
203
                "Update on Your SmartDukaan Free Trial Request",
201
                body
204
                body
Line 222... Line 225...
222
 
225
 
223
 
226
 
224
        String[] emailTo = {trialForm.getEmail()};
227
        String[] emailTo = {trialForm.getEmail()};
225
        String[] cc = {"tarun.verma@smartdukaan.com"};
228
        String[] cc = {"tarun.verma@smartdukaan.com"};
226
 
229
 
227
        Utils.sendMailWithAttachments(
230
        emailService.sendMailWithAttachments(
228
                mailSender,
231
                mailSender,
229
                emailTo,
232
                emailTo,
230
                cc,
233
                cc,
231
                "We’ve Received Your Interest in the SmartDukaan Franchise",
234
                "We’ve Received Your Interest in the SmartDukaan Franchise",
232
                body
235
                body
Line 269... Line 272...
269
        ccList.add(asmAuthUser.getEmailId());
272
        ccList.add(asmAuthUser.getEmailId());
270
        ccList.add("tarun.verma@smartdukaan.com");
273
        ccList.add("tarun.verma@smartdukaan.com");
271
        String[] cc = ccList.stream()
274
        String[] cc = ccList.stream()
272
                .filter(email -> !email.trim().isEmpty())
275
                .filter(email -> !email.trim().isEmpty())
273
                .toArray(String[]::new);
276
                .toArray(String[]::new);
274
        Utils.sendMailWithAttachments(
277
        emailService.sendMailWithAttachments(
275
                mailSender,
278
                mailSender,
276
                emailTo,
279
                emailTo,
277
                cc,
280
                cc,
278
                "Franchise Upgrade Request - " + applicantName + ", " + trialForm.getBusinessName(),
281
                "Franchise Upgrade Request - " + applicantName + ", " + trialForm.getBusinessName(),
279
                body
282
                body