2015年5月25日星期一

NetTuts.com: E-mail List Alternatives With PHP: Using Mailgun's List API


In a new tutorial posted to the NetTuts.com site they show you an alternative method for sending emails from your PHP application: using the Mailgun API. This API provides an interface into the Mailgun service, specifically made for sending emails without the hassles of hosting your own email server.



Over the past couple years I've run into various frustrations with both open source email list applications and paid cloud-based providers. In this tutorial, I'll guide you through my adoption of Mailgun.com, an economical solution I've been using successfully now for two years. [...] Mailgun is a cloud-based SaaS email cannon, like SendGrid. It's actually free for up to 10,000 emails per month. Mailgun is incredibly powerful and offers a well-documented API in a variety of popular languages. It provides for both send and receive capabilities, the latter of which can be quite difficult to develop from scratch. While Mailgun doesn't provide templates for rich HTML newsletters, it provides a platform upon which you can build anything.


He shows you how to use the service using a simple "ListApp" application (found on GitHub here) that provides some of the most common email list management functionality. He shows you how to set up a free Mailgun account and where to find their PHP SDK for the PHP integration. He then gets into the code examples, showing how to connect to the API via the SDK and doing tasks such as:



  • Creating and update a mailing list
  • Importing members to a list
  • Showing a list of current list subscribers
  • Send a new message
  • Synchronizing lists and members


He ends the post with a quick section about extending the ListApp application (or the PHP SDK) with a suggestion to add better error reporting or a queue system to manage the remote API requests more efficiently.


Link: http://code.tutsplus.com/tutorials/e-mail-list-alternatives-with-php-using-mailguns-list-api--cms-22824

SitePoint PHP Blog: CRUD (Create Read Update Delete) in a Laravel App


The SitePoint PHP blog continues their series around the creation of a basic CRUD (create, read, update and delete) application with PHP. In this second part of the series they build on the simple application in the first part and enhance it with the remainder of the CRUD handling.



In the previous part, we've bootstrapped our Laravel CRUD application by creating the database, some controllers, basic routes and simple views. In this part, we'll wrap things up and implement proper CRUD.


He jumps right in and creates the controller action and view to take in new "Task" information. This includes the installation of the Illuminate HTML package and setup of the needed provider and facades. He shows how to create the Task model and hook the results of the request into it and make the new record. This includes some basic "required" validation too. He then shows how to read and display the list of current tasks as well as setting up the edit and delete actions for each task.


Link: http://www.sitepoint.com/crud-create-read-update-delete-laravel-app/

Mikkel Høgh: Drupal is still a gated community


In a recent post to his site Mikkel Høgh makes the suggestion that Drupal is still a gated community, mostly as it relates to the process around the "Project Applications" process.



One of the things the Drupal community prides itself on, is how open the community is. And that is generally true, but there's one exception. And that is the Kafkaesque horror-show we subject any newcomers that would like to publish their code on Drupal.org to. It goes by the name of "Project Applications". I know several people who've hit this wall when trying to contribute code. It's not uncommon to wait several months to get someone to review your code. And when it does happen, people are often rejected for tiny code style issues, like not ending their comments with a period or similar.


He talks about other factors involving reviews and delays that can also cause authors to abandon their work and feel "unwelcome and unappreciated". He mentions the "review bonus" system and how it's used to encourage participation (or "more hoops" as he puts it) from other authors. He notes that this situation mostly relates to those new to the tool and community and suggests that it just doesn't work (and really is unnecessary). He ends the post with a call to "end the madness" and move to a standardized role that would allow developers to publish without pushing people away and making them feel unwelcome.


Link: http://mikkel.hoegh.org/2015/05/14/drupal-is-still-a-gated-community/

NoCapes Podcast: Interview with Luke Stokes


The NoCapes podcast has posted their latest episode, hosted by PHP community member Kayla Daniels. In this new episode she talks with Luke Stokes of FoxyCart.



In this episode of NoCapes, Luke Stokes discusses the journey towards hypermedia APIs, what is it and why hypermedia APIs are important.


You can watch this latest episode either on the NoCapes site or over on YouTube directly. If you enjoy the show you should subscribe to their mailing list and get more information as it's sent.


Link: https://www.youtube.com/watch?t=39&v=j43ZYS_wc8g

Marc Aube: Design Pattern: Specification


Marc Aube has a new post to his site that introduces you to the specification design pattern, a technique that's useful for ensuing the current state of an object is valid.



The specification pattern is a software design pattern used to codify business rules that state something about an object. These simple predicates determine if an object's state satisfies a certain business criteria. They can then be combined to form composite specifications using logical operators. Use a specification to encapsulate a business rule which does not belong inside entities or value objects, but is applied to them.


He suggests a few things the pattern could be useful for like validating the current state or define how an object should be created. He gives a few more "real world" examples and then gets into the code to create a custom specification. In his "CustomerIsPremium" spec he defines a single method on an interface to determine if the Customer given is correct. He then creates a class instance and encapsulates the logic inside its "isSatisfiedBy" method. He also includes a bit more complex example, showing how to create a composite specification for handling grouping like "and", "or" and "not" assertions. Finally he looks at how to build specifications that can be passed in and used as selection criteria. He does point out that this can leak database handling into the specification layer, however, and should really be avoided without a inversion of control method in place.


Link: http://marcaube.ca/2015/05/specifications/

Treatment Update

Hi Everyone,


I know it’s been a little while since I’ve sent an update, but happily that is because there hasn’t been much to report. I am still on the same clinical trial, and had a scan a month back that showed some tumor growth and some tumor shrinkage – this is what they refer to as “stable disease”. I’m still tolerating the treatment pretty well.


That said, my doctor is a little concerned about some growth we’re seeing in one of my lymph nodes and we’re starting to take steps towards a different treatment so that we’re prepared in the event that my next scan shows more tumor growth than we’re comfortable with.


So that’s pretty much where things are.


I’m having good days and bad days. It’s harder for me to do physical things – probably no golf for me in the foreseeable future, and even long walks can be a challenge. However, I’ve been able to focus enough on my good days to tinker a bit on the computer and make some progress building a web app I’ve wanted to create for a while.


I’m also enjoying spending time with the family, and am looking forward to some trips to visit family in Seattle and Minnesota this summer. Caitlin and I are reading quite a bit together, and she’s getting better and better at reading things for herself.


I’ll let you all know if/when things change with my treatment.


This post is part of the thread: Cancer – an ongoing story on this site. View the thread timeline for more context on this post.