Subversion Repositories SmartDukaan

Rev

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

Rev 4196 Rev 4206
Line 38... Line 38...
38
/**
38
/**
39
 * @author mandeep
39
 * @author mandeep
40
 * 
40
 * 
41
 */
41
 */
42
public class CRMEmailProcessor {
42
public class CRMEmailProcessor {
43
    private static final int DESCRIPTION_MAX_WIDTH = 1900;
-
 
44
    private static final String MAILOR_DAEMON_EMAIL_ID = "mailer-daemon@googlemail.com";
43
    private static final String MAILOR_DAEMON_EMAIL_ID = "mailer-daemon@googlemail.com";
45
    private static final Log log                   = LogFactory
44
    private static final Log log                   = LogFactory
46
                                                           .getLog(CRMEmailProcessor.class);
45
                                                           .getLog(CRMEmailProcessor.class);
47
    private Client           client;
46
    private Client           client;
48
 
47
 
Line 201... Line 200...
201
 
200
 
202
        String content = "From: " + message.getFrom()[0].toString()
201
        String content = "From: " + message.getFrom()[0].toString()
203
                + "\n\nSubject: " + message.getSubject() + "\n\nBody: "
202
                + "\n\nSubject: " + message.getSubject() + "\n\nBody: "
204
                + messageContent;
203
                + messageContent;
205
 
204
 
206
        if (content.length() > DESCRIPTION_MAX_WIDTH) {
205
        if (content.length() > CRMConstants.DESCRIPTION_MAX_WIDTH) {
207
            content = content.substring(0, DESCRIPTION_MAX_WIDTH);
206
            content = content.substring(0, CRMConstants.DESCRIPTION_MAX_WIDTH);
208
            content += "\n\nTHIS TEXT IS TRUNCATED. PLEASE VISIT INBOX TO SEE COMPLETE DETAILS.";
207
            content += "\n\nTHIS TEXT IS TRUNCATED. PLEASE VISIT INBOX TO SEE COMPLETE DETAILS.";
209
        }
208
        }
210
 
209
 
211
        return content;
210
        return content;
212
    }
211
    }