You need to sign in to do that
Don't have an account?

Inbound eMail Handler - monitor incoming mails
Hi,
I add a inbound email handler into my org to add a new record in a custom object (bt).
Sometime the mails are not processed and I don't know why. Is there a way to check the incoming mails in Salesforce?
can I enter a line in the code where the process should begin and end? Because sometimes is some text before or after the relevant points.
Sascha
I add a inbound email handler into my org to add a new record in a custom object (bt).
Sometime the mails are not processed and I don't know why. Is there a way to check the incoming mails in Salesforce?
can I enter a line in the code where the process should begin and end? Because sometimes is some text before or after the relevant points.
global class btFromEmail implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) { Messaging.InboundEmailResult result = new Messaging.InboundEmailResult(); bt__c C = new bt__c(); if(email.plainTextBody != Null && email.plainTextBody != '') { String[] emailBodyRows = email.plainTextBody.split('\n'); for (String bodyRow:emailBodyRows) { String[] rowContents = bodyRow.split(':'); String label = rowContents[0].trim(); String value = rowContents[1].trim(); switch on label { when 'Firstname' { c.Firstname__c = value; } when 'Lastname' { c.Lastname__c = value; } when 'Birthdate' { c.Birthdate__c = date.valueOf(value); } when 'Phone' { c.Phone_private__c = value; } when 'Email' { c.E_mail_private__c = value; } } } } insert c; return result; } }Thanks,
Sascha
I think their is no standard way to track incoming emails if it is not getting tagged to any record or stored. A custom solution can be built where first process in email handler should be to store the email itself and then do the processing.
Thanks