Jump to content

Recommended Posts

Posted

If I have built a mail class (I made it before I started using processwire), should I make it a module or just include it and go from there?

Posted

I would prefer module because it's more PW way. 

It worth to mention that there is WireMail module that handles sending of email in PW. Also, there is WireMail SMTP that extends mentioned class.

You can go with a similar approach: create a module that will extend WireMail class by hooks where you can specify some specific things from your custom mail class.

 

  • Like 2
Posted

I need the mail class (or module) to be able to handle attachments... does wiremail allow for that too?

Edit: I am slow, yes it does... I'll check it out... thanks Zeka

Posted

In general I'd say build classes as independent as possible from processwire and to integrate it in PW just add a module as wrapper around your class, which does tie any processwire specifics (hook / module config / process interface / …) into what your class does on it's own. 

  • Like 4

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...