Sending email through mailgun wordpress plugin


On digitalocean with the mailgun wordpress plugin, for some weird reason it is not working even though I configured postfix.

I’m following the tutorial already through setting up a relay with these tutorials: How to Set Up a Mail Relay with Postfix and Mailgun on Ubuntu 16.04 and Configure Postfix to use Mailgun SMTP Relay on Ubuntu .

After setting it up, I realized it still would not pickup from that. So, I decided to use the mail() of PHP. The reason is that if I call wp_mail() in another plugin, and I do not know yet if mailgun plugin has kicked in already (that’s still something I should research).

So what happened was first try to use the default mail() function, then if it still fails ($result = false) then try wp_mail() (which I do not know if mailgun plugin already over-rode).

My next step to make it more elegant is to actually put Mailgun’s latest class through composer and use Bedrock so wordpress is using composer.



Learning magit


I attended a recent Javascript meetup where Zak showed us the power of using emacs for javascript.

For me, other than note taking, the thing I like to really learn is using the emacs magit plugin. To get it installed in a cinch, I did brew install magit. Yes, I am lazy and brew is amazing. Also note that I also got the emacs from brew as well, btw.

One thing I struggled a bit was intalling other plugins. After getting the melpa repo wired in to emacs, it was a simple M-x list-packages and then Ctrl-s magit (which searches for magit) then pressing i (mark install) and x (execute).

So for my first thing to try, I went to my dotfiles repo and tried to commit something new. After opening a file using $ emacs <filename>, I just typed M-x magit- and pressed TAB. I found the command to use: M-x magit-commit and then typed my commit message. Then, to finish up the commit and actually commit, I typed C-c C-c. And it was commited.

Since I was on master and will push to master, I just did M-x magit-push-popup and then pressed P.

Well magit was easier than I thought it was. Hope it was a nice introduction to using magit.

I’m pretty sure I’m just touching the tip of the iceberg of what it can do, will keep posting new learnings about using magit as I go along.

Life snapshot Q1 2016


##What I’m studying

  • Figuring things out with front-end tools (ES6/Babel/React)
  • Checking out PHP7


  • Venice Piazza Mall is almost finished
  • Team building to Balagbag
  • Discovered Salad Lunches at Rustans Fresh Foods
  • Finally tried to swim again at the Gym


make npm3 install look like npm2


Got this tip from a friend - rico sta. cruz:

Just set the config to use loglevel http and not show the progress bar progress false and you’re good to go.

npm config set loglevel http && npm config set progress false

[TIL] defaults and extends work together


So today I just discovered the _.extends function of underscore. There’s a little known function that is similar, called _.extendsOwn. This basically is the underscore version for the upcoming ‘Object.assign’ method of ES6.

I didn’t like how javascript mutates objects and doesn’t make the code any easier to understand. So in a function I was creating that originally mutates to object without returning anything, I needed a way to copy the object and modify it, then return it back. One way to do that is to get copy the object to another variable, completely and without reference to the original object that got passed in. So that’s what led me to figure out how to use extend and decided on using extendOwn

Long story cut short - I wanted more info about these functions which led me to this article:

Extending objects in underscore

There’s this method that is very similar to extend, called _.defaults that is really useful. Imagine you have an existing object that you dont want certain properties (and their values) to be overwritten when merging other objects into it. That’s what defaults are for basically. Any present values in the existing object wont get overwritten by other object’s attributes.

The use cases are for the times that you want to exclude certain properties when merging together objects. One application is pushing data to an incrementing indexing NoSQL database that absolutely must have the same identifier in the JSON message, to be able to search for it later.

So cool. For more info on extend, checkout this 2ality article

Joe Palala

Web/UX Developer. Laravel PHP Community organizer.


Latest Comments

    Recently Visitors