-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
7Questions
-
2Replies
Actionate custom email handler from Email-to-Case
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!
- Dayene
- February 24, 2023
- Like
- 0
- Continue reading or reply
How to close child tab Aura component
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?
When I try to close chat tad, case tab is also closed.
- Dayene
- May 23, 2022
- Like
- 0
- Continue reading or reply
Automated Process User’s email address isn’t valid
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.
- Dayene
- February 16, 2022
- Like
- 0
- Continue reading or reply
dsfs:Too many SOQL queries: 101 when using DocuSign
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...
- Dayene
- December 28, 2022
- Like
- 0
- Continue reading or reply
How to open a web page via APEX?
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
- Dayene
- November 01, 2021
- Like
- 0
- Continue reading or reply
Send notification to members of the queue when I create a new case
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.
- Dayene
- May 18, 2021
- Like
- 0
- Continue reading or reply
Permission to register an email on Outlook
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.
- Dayene
- May 14, 2021
- Like
- 0
- Continue reading or reply
Send notification to members of the queue when I create a new case
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.
- Dayene
- May 18, 2021
- Like
- 0
- Continue reading or reply
Permission to register an email on Outlook
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.
- Dayene
- May 14, 2021
- Like
- 0
- Continue reading or reply