You need to sign in to do that
Don't have an account?
InboundEmail - not working for an group
I have written an Apex class, that converts incoming emails according to the toAddress (I know, it's great - thanks ^^ )
anyway, it is working perfect, when I send the email to the emailService generated address. However, in order that my users will not see such addresses, I create an alias group in our mail server (google for instance) and give the name a more suitable/readable name.
Here where the class breaks.
First debug code is with the direct address, as you can see, the SOQL returns 1 row (as should)
10:21:15.091 (91499000)|SOQL_EXECUTE_BEGIN|[33]|Aggregations:0|select Id from User where Alias = :tmpVar1 10:21:15.097 (97818000)|SOQL_EXECUTE_END|[33]|Rows:1
Second log, is when using th elias/group (the only address in the group is the same one as in first example) however, this time, nothing is returned from the SOQL
10:14:46.127 (127098000)|SOQL_EXECUTE_BEGIN|[33]|Aggregations:0|select Id from User where Alias = :tmpVar1 10:14:46.132 (132488000)|SOQL_EXECUTE_END|[33]|Rows:0
I assume it's something in the way either Google transforms/creates/forwards email?
Anyone has an idea?
ok, some more information.
I have executed with full debug. I think that the toAddresses[] is populated both with the original address (the group) and also with every single email that is in the list.
So I have to tweak my code to go over the <LIST> and to check for the beginning of the known string I use (lead).
I still get an error, here is some more of relevant code.
This is my Apex code:
These are lines from the debug log:
Here is some debug from the while loop, i have a feeling something is wrong here, as I see out of bound error, but can't point it out.