Passing config into model

The whole system is a bit like a cross between a discussion forum and a mailing list. The Email\Model\EmailModel is a big long object that handles all email interactions. For example, when a new comment is made using CommentController it uses EmailModel to send the administrator a notification email. EmailModel is used from quite a few different Controllers to also handle sending out a bulk daily update email to subscribers.

There isn’t much of an EmailController used. the Email module stores all the email templates in the view, then EmailModel puts these together using the Config variables like ‘account name’ @ ‘domain name’, maybe a Comment title & body from a Doctrine entity in the case of the admin notification email and actually sends the email.

The EmailModel handles all the email building & sending for the system and is used by different controllers. I suppose that I could take all the functions out of the EmailModel and put them in their respective Controllers, continuing to use the email templates in Email/view.

Coming from a Doctrine perspective, all the use of Models in the Laminas tutorials & docs deal with database interaction, so it’s tough to see how non-database Models are supposed to work within Laminas.