function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krish@123krish@123 

How to pass current record id in in bound emails services...........Please help me

Hi 
 I need a helo for resolving  for below code

Iam sending emails  from  selected usere on Contact VF and saving record while saving iam sending emails for users and aslo saving records.

Now i need  to pass  current record id ( which i have saved) in inbound emails
I tried to send the record id  as  email.subject 

I am getting but i need to pass this email.subject or current id in soql

so that while replying from email .there is a status custom  field on contact object will become true.






global class createMemberInbound implements Messaging.InboundEmailHandler {
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, Messaging.InboundEnvelope env) {
    
        Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); 
        String myPlainText= '';     
        myPlainText = email.plainTextBody;  
        Event[] newevent= new Event[0];
        MailSendingDetailsDTO__c mail = new MailSendingDetailsDTO__c();
            
        try 
        {
                   contact mem;
                   memb = [Select Id, Name, Email,Status__c  From Contact where id= :apexpages.currentpagereference.getparameter().get('id') ;
                   System.debug('-------------Error is mem------------:'+email.fromAddress);
                   mem.Status__c= true;
                   mem.Accepted_By__c = email.fromname;
                   System.debug('-------------Error is mem.Status_for_invitation__C------------: ' +mem.Status_for_invitation__C);
                   upsert mem;
        } 
          
        catch (Exception e) 
        {
            System.debug('Error is: ' + e);
        }   
            result.success = true;
            return result;
    }
}

Thanks