I have thought a bit about newsletter integration and how an emailer setup would work from within ProcessWire, either by building something natively or integrating with Campaign Monitor / Mailchimp.
I have a couple of sites for organisations with medium-sized memberships. These need to email their members from time to time so I built a dead simple module to do this which supports a single email template. You can take a look here. Please feel free to build upon this, or just take the basic idea and run with it.
https://github.com/ffub/ProcessMailer
These are the benefits I can see from building a complete web mailer in PW:
Ease of use My clients already know how to use the PW backend
All of them find Campaign Monitor and MailChimp very hard to understand and use, especially the latter
Content management all in one place. They can manage their web presence all from the backend of their site
[*]Tight integration with user database. You can easily create a mailing lists with PW’s awesome selector engine, eg: $users->find(“roles=5810, newsletters=news|offers”)
[*]Create email templates based on the PW templating and field system
Multiple email templates
Familiar API
Keep your templates alongside your front end templates
Use templates for system messages
[*]Because sent mails would be stored in the system as Pages and the templates would be on the server,
These are the negatives
Your server will get blacklisted! Preventing users from marking your email as spam is a pretty herculean task. If you use the web server the site is hosted on to send the email then a blacklisting will also affect the system messages send out by all the sites on that server.
You can work around this somewhat by allowing the web mailer to use a separate SMTP host in its settings. Hiring an SMTP host for bulk mailing will typically cost you more than just using Campaign Monitor or MailChimp. Hosts such as Gmail will only let you send up to 500 messages and will frown upon sending bulk mailings through their service.
Performance: Sending multiple HTML emails can be very slow. I’m not sure how much offsetting the sending to an SMTP server improves this, but it’s definitely a concern on a web server.
Bounces: You would have to setup the mailer on your server to route these to ProcessWire. Even then, it’s quite a job working out which are actual bounces and which are Out of Office messages or genuine replies.
Metrics: Email analytics is a task best suited to the big boys.
How would you build an emailer in processwire?
I think it would actually be pretty simple to build a pretty powerful Mailer.
Lists would be created by choosing a role, or using a selector for more advanced ones.
Templates would be stored alongside regular page templates and you’d use the familiar $page API within them. Eg $page->subject. The rich text editor field might need some trickery to make sure all links and image paths are absolute URLs including the hostname.
Campaigns or Messages would be created as pages. You could have draft and sent statuses or parents. It would be possible to view them on the front end too.
Your email templates could easily pull in data via the Page field type, allowing you to sent out emails for events and the like with ease.
Text versions could either be based on an alternative template (multiple files per template may be tricky) that strips out any HTML or by running the HTML template through Lynx on the server, which makes for a unix/cygwin dependency. If you used Textile or Markdown for your body field rather than TinyMCE this would be less of an issue to work around.
An analytics field in the settings would let you enter a Google Analytics ID. Links could then be tracked with Google's campaign tracking
I’m certainly keen to look into the templating side of this over Spring as I’d like to use HTML templates to send some of my notification messages.
thanks,
Stephen