Subversion Repositories SmartDukaan

Rev

Rev 35360 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.service;

import com.spice.profitmandi.common.util.Utils;
import com.spice.profitmandi.dao.entity.fofo.TrialForm;
import com.spice.profitmandi.dao.service.loiForm.LoiFormServiceImpl;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

@Service
public class TrialServiceImpl implements TrialService{

    private static final Logger LOGGER = LogManager.getLogger(LoiFormServiceImpl.class);

    @Autowired
    JavaMailSender mailSender;

    @Override
    public void sentMailForTrialUser(TrialForm trialForm) throws Exception {
        String body =
                "Dear Team,\n\n" +
                        "A new trial registration has been received. Below are the submitted details:\n\n" +
                        "Applicant Name: " + trialForm.getFirstName() + " " + trialForm.getLastName() + "\n" +
                        "Business Name: " + trialForm.getBusinessName() + "\n" +
                        "Mobile: " + trialForm.getMobile() + "\n" +
                        "Email: " + trialForm.getEmail() + "\n" +
                        "GST Number: " + trialForm.getGstNumber() + "\n\n" +
                        "Address:\n" +
                        trialForm.getAddressLine1() + "\n" +
                        (trialForm.getAddressLine2() != null ? trialForm.getAddressLine2() + "\n" : "") +
                        trialForm.getCity() + ", " + trialForm.getState() + " - " + trialForm.getPincode() + "\n\n" +

                        "Please review the documents (PAN, Aadhaar, GST) and proceed with the next steps as required.\n\n";
        String[] emailTo = {"manish.gupta1@smartdukaan.com"};
//        String[] emailTo = {"aman.gupta@smartdukaan.com"};
        String[] cc = {"sm@smartdukaan.com", "gaurav.sharma@smartdukaan.com","tarun.verma@smartdukaan.com"};
        LOGGER.info("RegistrationBody - " + body);
        Utils.sendMailWithAttachments(mailSender, emailTo, cc,  "New Trial Registration: "  + trialForm.getBusinessName(), body);


    }
}