Recently, I had a case where customer was creating SPAlert object using SharePoint object model code and things were not working out well.
What seem to happen was that whenever the condition that warrants alert trigger is met (e.g., an item is changed in a list), the alert email that was sent out was not the custom alert email template customer had setup but it was the out of the box email template.
The customer had created a custom alert template by following How to create a custom e-mail alert handler in Microsoft Office SharePoint Server article.
After investigation we found that the code they were originally using did not have SPAlert.AlertTemplate property assigned with the correct value. Once we provided the correct alert template to this property, the alert that was created through SharePoint object model code recognized the custom email template and used that template in the emails that were sent when the alert trigger condition is met.
Below is the sample code.
Line number 21 above was the statement missing in the original code. We need to specify the SPAlert.AlertTemplate property in order to get alert emails sent out using the custom email template.
Hope this helps!