Let the platform do the work

Health Check Error: Invalid Status and Type for Emails

Overview

The Health Check wizard must be run when upgrading to evaluate whether your instance is suitable for upgrade. During the health check, various types of issues may be detected which can affect your ability to upgrade. This article will cover the "Unexpected values found in emails" (Invalid status and type for emails) error reported by the health check.

Symptoms

This generates an output similar to the following in health check:
HCArticleInvalidStatusAndTypeForEmails

This health check error occurs upon detecting the presence of invalid combinations of status and type in email records. Such invalid combinations can cause conflicts with the Emails module.

In the Sidecar Emails module, the acceptable, valid combinations of status and type for email records are as follows:

  • type='draft' AND status='draft'
  • type='out' AND status='sent'
  • type='out' AND status='send_error'
  • type='out' AND status='archived'
  • type='out' AND status='' 
  • type='out' AND status IS NULL
  • type='forward' AND status='sent'
  • type='forward' AND status='send_error'
  • type='archived' AND status='archived'
  • type='archived' AND status='sent'
  • type='campaign' AND status='archived'
  • type='inbound' AND status='unread'
  • type='inbound' AND status='read'
  • type='inbound' AND status='replied' 

The generated error message will list the invalid combinations present in the instance. The example error shown in the screenshot above tells that there are email records in the instance which have the following invalid combinations: 

  • type = 'draft' AND status = 'sent'
  • type = 'inbound' AND status = 'sent'

If there is such an invalid type and status combination flagged by the health check, then it means that there is potentially a customization that is setting an invalid combination in the instance.

Resolution

To resolve this error, modify any customizations that are setting an invalid type and status combination to prevent the creation of invalid email records. Once the customizations have been updated and validated, please navigate to Admin > Repair and perform a "Quick Repair and Rebuild".

The existing records in the database table with invalid combinations may also need to be updated as appropriate. After fixing the customizations and any affected records, perform the health check again and click "Confirm" to proceed with the upgrade.