Subversion Repositories SmartDukaan

Rev

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

Rev 3546 Rev 4142
Line 51... Line 51...
51
        // Ignoring mails from Mailor daemon
51
        // Ignoring mails from Mailor daemon
52
        if (MAILOR_DAEMON_EMAIL_ID.equals(parseEmailId(message.getFrom()[0].toString()))) {
52
        if (MAILOR_DAEMON_EMAIL_ID.equals(parseEmailId(message.getFrom()[0].toString()))) {
53
            return;
53
            return;
54
        }
54
        }
55
 
55
 
-
 
56
        // Try parsing the ticket Id from email with subject like Saholic#123 ...
56
        Long ticketId = parseTicketId(message);
57
        Long ticketId = parseTicketId(message);
57
 
58
 
58
        if (ticketId != null) {
59
        if (ticketId != null) {
59
            log.info("Response for Ticket: " + ticketId + ": " + message);
60
            log.info("Response for Ticket: " + ticketId + ": " + message);
60
            updateTicket(ticketId, message);
61
            updateTicket(ticketId, message);
Line 64... Line 65...
64
            log.info("Creating ticket for the same");
65
            log.info("Creating ticket for the same");
65
            createTicket(message);
66
            createTicket(message);
66
        }
67
        }
67
    }
68
    }
68
 
69
 
-
 
70
    // Parses regex like ^.*Saholic#(\d+).*
69
    private Long parseTicketId(Message message) throws MessagingException {
71
    private Long parseTicketId(Message message) throws MessagingException {
70
        Long ticketId = null;
72
        Long ticketId = null;
71
        String subject = message.getSubject();
73
        String subject = message.getSubject();
72
        if (subject != null) {
74
        if (subject != null) {
73
            Pattern p = Pattern.compile("^.*"
75
            Pattern p = Pattern.compile("^.*"