Subversion Repositories SmartDukaan

Rev

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

Rev 4241 Rev 4256
Line 38... Line 38...
38
import java.util.Calendar;
38
import java.util.Calendar;
39
import java.util.Collections;
39
import java.util.Collections;
40
import java.util.Date;
40
import java.util.Date;
41
import java.util.List;
41
import java.util.List;
42
 
42
 
-
 
43
import net.htmlparser.jericho.Source;
-
 
44
 
43
import org.apache.shiro.SecurityUtils;
45
import org.apache.shiro.SecurityUtils;
44
import org.apache.thrift.TException;
46
import org.apache.thrift.TException;
45
import org.apache.thrift.transport.TTransportException;
47
import org.apache.thrift.transport.TTransportException;
46
 
48
 
47
/**
49
/**
Line 402... Line 404...
402
                Client helperClient = new HelperClient().getClient();
404
                Client helperClient = new HelperClient().getClient();
403
                activity.setUserEmailId(helperClient.saveUserEmailForSending(
405
                activity.setUserEmailId(helperClient.saveUserEmailForSending(
404
                        customerEmailId, CRMConstants.CRM_EMAIL_SENDOR,
406
                        customerEmailId, CRMConstants.CRM_EMAIL_SENDOR,
405
                        subject, body, null, CRMConstants.CRM_EMAIL_TYPE));
407
                        subject, body, null, CRMConstants.CRM_EMAIL_TYPE));
406
 
408
 
-
 
409
                String plainTextbody = new Source(body).getTextExtractor().toString();
-
 
410
 
407
                // We change activityType to OTHER when pop up box for email
411
                // We change activityType to OTHER when pop up box for email
408
                // closes
412
                // closes
409
                activity.setDescription("Subject: " + subject + "\n\n"
413
                activity.setDescription("Subject: " + subject + "\n\n"
410
                        + "Body: " + body);
414
                        + "Body: " + plainTextbody);
411
 
415
 
412
                String activityDesc = activity.getDescription();
416
                String activityDesc = activity.getDescription();
413
                if (activityDesc.length() > CRMConstants.DESCRIPTION_MAX_WIDTH) {
417
                if (activityDesc.length() > CRMConstants.DESCRIPTION_MAX_WIDTH) {
414
                    activityDesc = activityDesc.substring(0, CRMConstants.DESCRIPTION_MAX_WIDTH);
418
                    activityDesc = activityDesc.substring(0, CRMConstants.DESCRIPTION_MAX_WIDTH);
415
                    activityDesc += "\n\nTHIS TEXT IS TRUNCATED. PLEASE VISIT INBOX TO SEE COMPLETE DETAILS.";
419
                    activityDesc += "\n\nTHIS TEXT IS TRUNCATED. PLEASE VISIT INBOX TO SEE COMPLETE DETAILS.";