Fix template attachment must be declared after template

On a fresh installation is not possible to install poweremail because template_attachment class must be defined after template class