• Dayene
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 2
    Replies

Hi there,
I have the following apex email handler which pourpose is to update de priority of a case create from email-to-case according to the priority that is informed on the subject of the email that originated the case:


global with sharing class EmailToCasePriorityHandler implements Messaging.InboundEmailHandler{
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
        Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
        System.debug('get in the email class');
        // Parse the email to extract the priority
        String subject = email.subject;
        Pattern pattern = Pattern.compile('(Case #(\\d+) - Priority (\\d)');
        Matcher matcher = pattern.matcher(subject);
        System.debug('subject' + subject);
        if (!matcher.matches()) {
            System.debug('does not match' );
            result.message = 'Email subject is not in the right format.';
            return result;
        }
        String priority = matcher.group(2);
        // Retrieve the case and update the priority
        Case theCase = [SELECT Id, Priority, CaseNumber FROM Case WHERE Subject = : subject LIMIT 1];
        if (theCase == null) {
            result.message = 'Case not found.';
            return result;
        }
        theCase.Priority = priority;
        update theCase;
        // Set the response message and status
        result.message = 'Case ' + theCase.Id + ' priority updated to ' + priority;
        result.success = true;
        return result;
    }
}


I have set up the email-to-case and it is working fine.

I have also configured the Email Services to this apex class.

But for some reason when a case is create from email-to-case this class is not being called.

What can it be?

And is there a better way to implement this custom email handler? Because I am using the subject of the email to retrieve the correct case to update.

Thanks!

  • February 24, 2023
  • Like
  • 0

Hi there,

I have an Aura component that is a chat. When the chat is started a case is created and the transcript and the new case are open.

When the chat is closed, we use closeTab() and then openTab() to open the case again.

But that way we lose the info already filled into the case.

I would like to close just the chat tab. But it seems that one is the "father" so I cannot close it without closing the case as well.

Is there a way to just close the chat tab?

 

User-added imageWhen I try to close chat tab, case tab is also closedWhen I try to close chat tad, case tab is also closed.

Hi there,

I am gettinhg the following warning in my flow, where I have a send email action, which has a no reply email address as the sender address:

xxxxxx (Action) - Because the Automated Process User’s email address isn’t valid, this flow can’t send emails for actions or errors. On the Process Automation Settings page in Setup, the Automated Process User Email Address must specify an organization-wide email address for the system administrator profile.

The proccess automation settings and the organization-wide email addresses are already set up correctly, though.

  • February 16, 2022
  • Like
  • 0

Hi there,

When I try to send a contract via DocuSign in Salesforce I get this error:

dsfs:Too many SOQL queries: 101

Have you ever came across this problem??

Thanks...

 

  • December 28, 2022
  • Like
  • 0
Hi there,

I have an action that calls an integration. And I would like to open a web site in this same button.

Is this possible?

Thanks
  • November 01, 2021
  • Like
  • 0

Hello, 

I have a flow that creates two cases for X queue. I'd like when these cases were created all the members in the queue received an e-mail notifying about them automatically. 

Does anyone know how to do this without creating a workflow rule or email alerts?

Thanks.

Hi there, 

I have a system adm profile in my sandbox that allows me to login and register emails on the Salesforce's suplement on Outlook.

I need to grant this permisson to another profile, but I can´t find what it is.

Do you have any idea of what permission, object or whatever I need to set?

Thanks in advance.

Hello, 

I have a flow that creates two cases for X queue. I'd like when these cases were created all the members in the queue received an e-mail notifying about them automatically. 

Does anyone know how to do this without creating a workflow rule or email alerts?

Thanks.

Hi there, 

I have a system adm profile in my sandbox that allows me to login and register emails on the Salesforce's suplement on Outlook.

I need to grant this permisson to another profile, but I can´t find what it is.

Do you have any idea of what permission, object or whatever I need to set?

Thanks in advance.