Non-Functioning Ubercart Invoice Emails

Ubercart Logo

A support request recently came in where a client had changed hosting for their Drupal 7 website and found that their email had ceased to work. To resolve the issue, they installed the SMTP module to use an alternative email server for sending messages from Drupal. That fixed the issue of system mail not being sent, but their Ubercart mail notifications still did not work.

Debugging revealed that the Ubercart invoice mail call was reporting success, yet was not actually dispatching any email.  That threw me for a bit, then I discovered that Ubercart takes advantage of the drupal_mail_system to use its own custom mail backend (a class that implements the MailSystemInterface interface).  There is a variable ('mail_system') that registers that custom mail backend -- the SMTP module's custom mail backend wasn't being used by Ubercart.

To fix this issue, I installed the mailsystem module and replaced all of the Ubercart-registered mail handlers with the SMTP module's mail backend.