Can any one help me on this ...
We are using the standard functionality of Task "Send an Email page" Send Button for the cases to reply to the customer.When the customers sends a email ,keeping in cc to service team a ticket is raised .when we click on the "Send Email Button" the cc is not getting copied . Any idea or suggestion what may be the issue.
Update - VF page constructs URL via controller as:
String redUrl = '/_ui/core/email/author/EmailAuthor?p2_lkid='+
cas.contactId+
'&p26='+cas.Email_to_Case_Address__c +
'&rtype=003&p3_lkid=' +cas.id +
'&p4='+cas.Email_CC_Address__c+
'&p5='+ cas.Email_BCC_Address__c +
'&p6='+subject+ '&retURL=/'+ cas.id ;
Portion of VF PAGE :
<apex:page standardController="Case" extensions="CaseCommentAndEmailPageController">
<apex:form >
<apex:messages />
<apex:pageBlock id="abc">
<apex:pageBlockButtons location="top">
<apex:commandLink value="Add Comment" action="{!addComment}" rendered="{!isButtonVisible}" target="_top" styleClass="btn custBtn"/>
<apex:commandLink value="Send Email" action="{!sendEmail}" rendered="{!isButtonVisible}" styleClass="btn custBtn" target="_top" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
Portion of Code:
public PageReference sendEmail(){
//old Code
System.debug('Working.....................');
if(cas.Email_CC_Address__c == null || cas.Email_CC_Address__c == 'null'){
System.debug('cas.Email_CC_Address__c = '+cas.Email_CC_Address__c);
cas.Email_CC_Address__c ='';
}
if(cas.Email_BCC_Address__c == null || cas.Email_BCC_Address__c == 'null'){
System.debug('cas.Email_BCC_Address__c = '+cas.Email_BCC_Address__c);
cas.Email_BCC_Address__c ='';
}
System.debug('cas.CaseNumber = '+cas.CaseNumber);
System.debug('cas.Subject = '+cas.Subject);
String subject = cas.CaseNumber+' - '+cas.Subject;
if(subject.length() >= 100){
subject = subject.subString(0,99);
System.debug('Sub cas.Subject = '+subject);
}
String redUrl = '/_ui/core/email/author/EmailAuthor?p2_lkid='+cas.contactId+'&p26='+cas.Email_to_Case_Address__c +'&rtype=003&p3_lkid=' +cas.id +
'&p4='+cas.Email_CC_Address__c+'&p5=' + cas.Email_BCC_Address__c + '&p6='+subject+
'&retURL=/'+ cas.id ;
System.debug('redUrl = '+redUrl );
PageReference pageRef = new PageReference('/_ui/core/email/author/EmailAuthor');
System.debug('End.....................');
pageRef.getParameters().put('p2_lkid',cas.contactId);
pageRef.getParameters().put('p26',cas.Email_to_Case_Address__c);
pageRef.getParameters().put('rtype','003');
String caseId = cas.id;
if(caseId != null && caseId.length() > 15){
pageRef.getParameters().put('p3_lkid',caseId.subString(0,15));
}
pageRef.getParameters().put('p4',cas.Email_CC_Address__c);
pageRef.getParameters().put('p5',cas.Email_BCC_Address__c);
pageRef.getParameters().put('p6',subject);
pageRef.getParameters().put('retURL',cas.id);
// pageRef.setRedirect(true);
return pageRef;
}
Any help very much appreciated.
email_cc_address__c
in context when getRecord() is called? (It won't unless that field is in the VF markup or you useaddFields()
method