When setting up an email bot in Pega 8.5.1 I observed that the three OOTB email reports (graphs) were not populated. Showing these OOTB email reports is a cool feature when giving a demo so I investigated why this was happening.
I am happy to share the root cause and hope they may be helpful for other architects in the future.
When I created an email account in Pega 8.5.1 in dev studio a number of warnings were introduced saying that I should use application settings for some of the fields. So I created application settings and used the data page D_GetApplicationSettingValue to to populate the fields. One of these fields was the field Email address in which I added =D_pxGetApplicationSettingValue[OwningRuleset:"EmailBot",Purpose:"EmailUserID"].pySettingValue instead of the Email address.
This causes an error in the activity pyPreProcessInteractionCase (step 7) as emailaddress is not compared with the value in the application setting but with the string in the field Email address.
This makes that property pyAccountID is missing in Declare Index pyTrackTriageActions causing the analytics tab not being populated in the Email manager portal.
After adding the email address and justifying the warning the analytics tab started showing results.
By the way, when you create the email account in the app studio and do not use application settings at all you won't run into this issue and no errors will be raised telling you to use application settings when saving the email account.
As I could not find an article yet that reported this behavior I decided to share it. Hopefully it saves some colleagues some time in the future.
***Edited by Moderator Marissa to add the Developer Knowledge Share tag***
Thanks @MichielJonkersDLL for the analysis. We haven't seen the issue so far so, if you don't mind, I'd be very much interested in finding the root cause.
pyAccountID property maps to EmailAccount configured in Email channel
EmailAccount is picked based on one of the email addresses in 'To' field of incoming email
I'm not entirely sure what Application Settings has to do with any of this. Can you please explain -
How you created email account
How you added it to email channel
What kind of account was it
Is there an alias or forwarding address associated with this email account
There is more robust way of knowing which email account is the incoming email associated with in 8.6 so this problem will not occur but still I'm interested in how it happened in first place. Thanks in advance.