Tech Distortion

Engineering Technology Automation Software


Article Categories

Extending Statamic's Raven "From Name"

I’ve recently integrated Raven Forms into my Statamic website and adding some new features as well as extending some existing ones: namely the feedback form. (More to come shortly)

I had been using Eric Barnes excellent email_form which uses the standard PHP Mailer however Raven gives me a bit for flexibility in a lot of other areas and supports third party transactional EMail services. There was one thing that annoyed me with Raven though: when sending EMails through it and Mandrill (my transactional EMail service of choice) the “From Name” was absent and all I got was an EMail address.

Given that A) the standard PHP Mailer supported this via Erics add-on in my previous implementation, B) a bit of research showed that Mandrill supports this as standard, and C) the little details like that bug the crap out of me; it was time to do something about it.

Hack The Core Code

Would I do such a thing? Apparently so. Ignoring some of my own advice previously whereby modifying core files on a platform that you don’t own/control is a recipe for long-term disaster and that I’m unlikely to perform the sorts of regression testing the Statamic team would do, push that to one side, stick your fingers in your ears and let’s hack…

Note: All line number references are for v1.8.4 of Statamic which is current at time of publishing, although the last modified date of most of these files goes back several revisions.

FILE: _app/core/api/email.php

Around Line 26:

public static $allowed = array('to', 'from', 'subject', 'cc', 'bcc', 'headers', 'text', 'html', 'email_handler', 'email_handler_key');

Becomes: (by adding ‘fromname’,)

 public static $allowed = array('to', 'from', 'fromname', 'subject', 'cc', 'bcc', 'headers', 'text', 'html', 'email_handler', 'email_handler_key');

Around Line 103: Insert:


Around Line 187:

$email->FromName = $attributes['from'];

Becomes: (by adding ‘name’)

$email->FromName = $attributes['fromname'];

Around Line 271 add:

 * Message fromname address
 * @var string
public $fromname = "";

Around Line 354 add the Setter/Getters:

 * Sets the fromname of the message
 * @param string $from
 * @return void
public function setFromName($fromname)
    $this->fromname = $fromname;

 * Gets the fromname of the message
 * @return string
public function getFromName()
    return $this->fromname;

FILE: _app/vendor/Stampie/MessageInterface.php

Around Line 18 add the Getter:

 * @return string
function getFromName();

FILE: _app/vendor/Stampie/Message.php

Around Line 101 add the Getter:

 * @return string
public function getFromName()
    return $this->getFromName();

FILE: _app/vendor/Stampie/Mailer/Mandrill.php

Around Line 59 add the Getter:

'from_name'   => $message->getFromName(),


Once all that has been updated (it’s really not that much in the grand scheme of things) all you need to do is add something like this to your Raven YAML formset:

  fromname: "John Chidgey"

Some notes to bear in mind:

  • I’ve only looked into Mandrill: the other supported mailers are your problem to figure out if you’re going to use them instead. The process should be very similar.
  • Hacking the Vendor add-on and the Core Statamic EMail Library is kinda a bad idea. I know, I know already…
  • I’ve raised a feature request at The Lodge but I’m impatient okay?
  • No warranty is provided, implied, or any other disclaimer you might choose to think of: Insert disclaimer here. Don’t cry to me if something breaks after doing this you good for nothing hacker.
  • Hackin’s…hackin’s bad…mmm-kay?


Death By Site

In Engineering there’s a branch or sub-discipline referred to as “Construction” and an industry built around it loosly called the Construction Industry. When I walk down a city street where normal people see a nice new building, I see the scaffolds long since removed, the site sheds hung precariously above and around the site, the hi-vis clothing, hard hats and steel-cap boots on the people that built it.

Less visible to normal people is the electricity we use every day, that powers the trains, our lights and the TV. Carried by wires from far away and in my country at least for some time now, from a place near a coal mine, way out west where the rain don’t fall. Places where previously only farmers looking for cheap land would consider, Turns OutTM that vast reserves of Coal, it’s Coal-Seam Gas, Iron Ore or Bauxite are buried deep below the surface, waiting to be extracted. New mines, new gas plants, compression facilities, more construction driven by mineral extraction.

In the construction industry you understand very early on that if you want a job, you have to go to wherever the work is. The vast majority of people are attracted to the bright lights and conveniences of city life. Unless you are in the construction industry in the city, you’re constructing something in the middle of nowhere: especially if it’s mining related where the jobs currently are in Australia in construction. Whenever the commute to/from site extends beyond several hours in this modern age, we tend to catch a plane and fly in, fly out (FIFO)1.

When the demand is high the salaries skyrocket and lure people away from their city-bliss. Chasing dollars we embrace the FIFO lifestyle which for some projects I have seen from the outside can be 28 days on, 9 days off and 2 of those 9 days off are spent travelling home (presumably). More common in the industry where I live at the moment are 21 days on, 7 days off. Even this is nothing compared to off-shore operations where the cost of extraction from an oil platform is so high that it’s usually 3 to 6 months at a time.

These cycles are sometimes referred to as rotations but more commonly as “swings.” Time on site is measured by the number of swings you’ve completed and you’re often asked: “where are you in your swing?” meaning, how long until home time? Swings have a large number of hidden problems that aren’t obvious at first.

Changeover: Handling the off-time is the first issue. No longer can one person be “site supervisor” for example, there needs to be two people which means two contact numbers, EMail addresses or shared ones at least. You spoke to Person A when they were at the end of their swing but did the message get through to Person B whose swing just started? The “other person” is usually referred to as your “back to back” or “b2b” for short. Also with changeover and overlap, imagine a Monday that lasts for two to three days. When you’re on a long swing it takes days to get caught up on what you missed when you were away and these are the danger times when accidents and ommissions tend to be more frequent. Productivity drops significantly during changeover as everyone finds their feets and hands-over what they were working on.

Forgetting Frustration: You jump on the plane, arrive on site and realise you’ve left something you needed at home. Enjoy three weeks of frustration as you pine for it and kick yourself. If you’re lucky you could contact someone about to start their swing and get them to bring it with them (maybe) but if not, you’re in the middle of nowhere. Better get used to living without that item for a while. Hope it wasn’t too important. That leads many people to keep an on-site locker box of sorts to keep the vast majority of their little items, things they use exclusively on site such that there is less to remember. Some sites are organised and you’re assigned a lockable locker, but many aren’t. In those cases, just don’t leave your valuables there.

Mind on the Job: As the end of your swing approaches you think almost exclusively about going home. That only leaves a small fraction of your mind on the job. That’s when accidents happen. Safety culture has had to become so much stronger in FIFO situations to combat this problem and keep safety at the forefront of peoples minds.

Relationship Killer: What follows is my personal experience and obviously this will vary from person to person. I’d been promoted to Senior Engineer, pay rise, more responsibilities, and the company had landed two back to back contracts in Townsville, which is a 1.5hr flight away from home, two flights in and out of Brisbane a day. Not bad by remote standards and in fact, Townsville is the largest city outside of the South-East of my home state of Queensland (still on the small side at 90k people). But it may as well have been the moon so far as my family were concerned. I was away never longer than a week at a time and home for weekends2. This is how a typical week away would unfold, conversing with my wife, from her perspective3.

  • Day 1: Everything’s fine. Kids are being, well, kids. The “man task” that needs doing can wait until you get back.
  • Day 2: I miss you. The kids miss you. House is a mess but I don’t care at this point. When are you coming home?
  • Day 3: I’m glad you’re having a good time away because I’m not. These kids are doing my head in. We don’t need the money I need you here. That unfinished “man task” is driving me crazy.
  • Day 4: You’re never here. It feels like I’m a single parent. I didn’t sign up for this. Why am I doing this?
  • Day 5: Thank god you’re coming home today. I am so over this. I know we need this job but surely there are other jobs closer to home?

It should come as no surprise that after a few years of this on and off my marriage was under a heavy strain and I wasn’t even on anything longer than a 5 day swing. I’ve worked with people that have been through much tougher FIFO swings than my experience. Perhaps there are some couples that can handle that sort of separation. Perhaps it’s harder when younger children are thrown in the mix. For those that suggest there needs to be more support or understanding to them I’d say: you try juggling three children under 6 years old by yourself each week. It is being a single parent and it’s not easy.

It really doesn’t matter what other people might think: I love her and my children, I could see the end result and it wasn’t working, so I got out and changed jobs. Things recovered and life returned to normal. For many people, they don’t address it and keep plodding along then the wheels fall off and their relationship ends. I’ve watched it happen to my workmates. Make no mistake: statistically speaking most relationships you enter before taking up a FIFO job will be placed under significant stress as a direct result, no matter how strong you think your relationship is. Be under no illusions.

Suicide: Statistics clearly show that FIFO workers have double the national average suicide rate in Australia. Whilst there are many different reasons people take their own lives the most clear paths down that road I can see based on my own observations are as follows.

  • Younger people with either young or no children are drawn in by the money. They get used to the money and find it difficult to go back to lower paying city jobs. They then become “trapped” by the lifestyle. The old joke in the mining industry is “It’s harder to get out of the mining industry than to get into it…” After a while they realise they’ve allowed themselves to become trapped in the lifestyle with no easy way to get out again and that is all their life becomes.
  • The reason they went to site to earn money to help their growing families financial needs is taken away from them as their relationship falls apart and they lose their family. With that motivation gone, what else is left?
  • Being on remote sites is mentally similar to imprisonment. There is only one flight out sometimes a month apart. You feel like there is no way out. Talking to loved ones on the phone becomes painful when you hear about things you would normally help them to handle but currently can’t. You feel helpless. You feel powerless. You feel trapped.

There’s a saying in the industry, “this is a young mans game” meaning to infer unattached with minimal connections to family. Whilst it’s not meant to be gender specific, men are typically drawn to these occupations for reasons I can’t honestly fathom and last time I checked, I’m a man. Why is it then that I see just as many older men at these sites? I honestly believe that people become caught up in the lifestyle. Going from one remote construction project to the next, in an endless site-based daze. One night at dinner in the mess hall, a typical night, let’s go around the table: Divorced, divorced, middle-aged man never married, kids grown up and left home, divorced, young man never married, third marriage and so on4.

It’s a story of broken hearts and broken promises in pursuit of the dollar and whilst the work itself can be rewarding, the majority of people I’ve spoken to just shrug off the negatives and get back to work.

I don’t want to be that person. I’ve tried so very hard to stay close to home and whilst I haven’t always achieved it and it’s been a constant battle to stay out of. Yes I’ve given up some opportunities, lots of extra money and some experiences but I don’t want to end up like so many I’ve seen. Perhaps it wouldn’t quite end with death by site but rather an emotional crippling. It’s not about “man-ning up” and getting on with it, it’s about understanding what matters to you. Some would say they have no choice, but if you look hard enough, there is always a choice. You mightn’t like the alternatives but the choice exists.

And so we return to those things we take for granted: the buildings, the TV and the Light Bulbs. For those that look at a light bulb and think, “it’s glowing” I don’t only see that. I think, how many people have given up so much of their lives to get the coal or gas to drive the generator to power that stupid light bulb?

Then I turn it off.

  1. No, not a First-In First-Out buffer you software people…Geez… 

  2. During the construction of Horseshoe Bay STP I was the weekend relief guy to give the primary site programmer a break. This was only for a few weeks and I had days off in Brisbane during the week. 

  3. My wife has reviewed the follow sub-section and says it accurately reflects her feelings on the subject matter. 

  4. That’s actually the result of a conversation I overheard just last week on site in the mess hall at the adjacent table. It was in response to a young sparky announcing he’s getting married in three months time. 


Pragmatic Feeds

I’ve resisted for some time however upon significant deliberation I’ve decided to offer additional feeds for listeners that only want to listen to the main episodes but not the follow-up episodes, and I suppose, for the sake of covering all permutations and combinations the reverse as well. The main feeds remain unchanged, however there are now additional feeds you may select from the Pragmatic landing page.

I’m finally organised with the follow-up deluge and there are many more additions to come.

Thanks as always for listening and I appreciate your patience as I take on listener feedback to improve and refine the show.


Podcasting Live

It’s now been three and a half months since I took Pragmatic Indie and I’ve been gradually adding features to the site as I’ve been going. One of the features I’m adding as of today (trialled two weeks ago when recording Tangential Episode 3) is podcasting live.

In addition I’ve set up an IRC chatroom with a web-embed that you can join in discussion during the show. I’ve done live recording of Pragmatic in the past (Eps 10-14) where Ben Alexander used MixLr which for Ep 15 proved problematic and live streaming was originally shelved as a result. I’ve gone with a self-hosted solution using Nicecast to broadcast a stream to Icecast 2 hosted on a Digital Ocean VPS. It’s much better quality and seems to be more stable.

I have an IRC Bot that keeps an eye on the IRC channel however I’m still working through the ShowBot. I’m forking the newer and well-known 5by5 ShotBot and learning a bit of Ruby and Rails while I’m at it. Also considering trying Casey Liss’ ATP ShowBot as well to see how it works out in comparison. Ultimately the ShowBot will be added as I have spare time in coming weeks.

The next episode will be live streamed just after 2pm US EDT this Friday the 22nd of August.

Sat 4:00am Fri 2:00pm Fri 11:00am Fri 7:00pm

For the next few weeks times will be announced each week as they will vary each week depending upon guest-host availability.

As always please join in live in the chat room and chime in with whatever you like for Tangential however note that for Pragmatic the following:

  • I’ll be reading the chat room from time to time during the show but will only comment on items that relate to the topic under discussion.
  • Title suggestions are welcomed but until the ShowBot is ready to go there won’t be any voting on titles.
  • I’m considering sticking around after the show has wrapped for a Q&A style format that I may release as a separate episode a la the Follow-up episodes.

Thanks as always for listening and I appreciate your patience as I pull all of this together.


Starting A Conversation

In the past few years I’ve been engaging with more people whose work I respect and admire from afar and it’s been an interesting experience. Prior to that people I admired I generally COULDN’T interact with except on very rare occasions when I was in the same room as they were, and given my tendancy toward social shyness I’d just hold back and say nothing. With Twitter and Skype in particular it’s easier than ever to get into a conversation with people you admire but otherwise could never speak to. I’m sure this has been written about before somewhere but what follows is my take on the reality of interacting with those you admire and starting a conversation.

Admiration isn’t a 2-Way Street

If you love what I do and I don’t know you or what you do, then how can you expect any admiration to be a two-way street. Be realistic. It’s usually just in one direction from you towards them. That said mutual admiration is a wonderful thing just don’t expect it out of the blocks: if ever. Be realistic.

They’re Different That What I Thought They’d Be

No kidding. You don’t say? Everyone acts and reacts differently based on who they’re talking to. If they’ve never spoken to you before then why would you expect them to talk to you like they have to other people that they’ve known for years. Is that obvious? Apparently not because I’ve heard that sentiment a lot. Any conversation you’ve had in your head with them (admit it, you have haven’t you?) isn’t going to play out that way in reality. Relationships take time to build and interacting back and forth on Twitter a few times or listening to them on a podcast has practically zero additive impact towards an actual relationship with that person. The image you build of that person in your mind is always going to be different to what that person is really like when you finally interact with them.

Zaphod just this guy…ya know

I don’t care who it is: your friend, the Prime Minister/President, the Queen, a stranger on the train/bus, we’re all just people. The problem with admiration is that human nature tends to elevate that person to a higher level of being, whereby they could be considered to be greater-than-human: so-called putting someone “up on a pedestal.” The sad truth is that when you talk to people they turn out to be, well, just ordinary people that did something you respect. When you’re caught up in the excitement of talking with someone you’ve admired from afar your excitement blinds you to that obvious truth.

The strangest thing that I’ve been dealing with in the last few months is the shift in people wanting to talk to me. For the first time really in my life, strangers have approached me and nervously struck up a conversation either on Twitter, on Skype or in person, and been gushing about being able to speak to me and that has been because of the popularity of Pragmatic. To me, this is extremely weird. Historically I’ve never really been anybody of any importance or interest (beyond my close family and friends). The attention feels awkward coming from strangers but it’s been an educational experience from the point of view that now I have my head around what I must have looked like when I previously sought a conversation with someone I admired. It’s flattering but it’s a bit creepy if you’re not careful about how you approach it.

If you are going to engage with someone you respect then try your best to talk to them like a person and keep any gushing to a minimum. Remember that Zaphod Beeblebrox is just this guy…ya know

You Can’t Always Invite Yourself

“If you don’t ask you’ll never know,” and “What’s the worst they can say? No?” are expressions I’ve heard time and again. Honestly don’t be angry, upset or annoyed if your attempts to strike up a conversation with someone don’t end the way you wanted them to. The people you admire have their own lives, their own stresses, probably including but not limited to their jobs, debts, spouses, children, in-laws and alligator swamps they need to contend with every, single, day. You are merely a tiny blip on a distant corner of their lifes radar. Remember that.

If someone respects what you do it’s always easier to strike up a conversation. Several of the guest-hosts that have appeared on Pragmatic did so because they listened to a few episodes and enjoyed the show. If not for that, they would never have agreed to talk to an otherwise complete stranger. Perhaps they would have agreed to chat given time and a lot of interaction back and forth. Perhaps not. There’s no point getting upset if they don’t respond or can’t respond. The best you can do is put yourself out there, be nice, be polite and courteous, oh yes, and be yourself. (hopefully there’s some alignment amongst those pre-requisites)

Ultimately though if you want to chat with them, you can’t always just invite yourself into their lives and expect to be welcomed. Send them an @mention on Twitter, an EMail or a message through their site feedback form (if they have any of those) but don’t expect a reply. Why shouldn’t you expect one? Imagine if someone like John Gruber typed a 140 character response on Twitter to each of his followers at 85wpm, 6 characters per word (23 words/tweet, 3.7 tweets/minute), 300k followers would take about 56 days, 7 hours, 21 minutes assuming no toilet breaks, no network delays and no fail whales. That’s not really a committment ANYONE can give. Ask yourself this question instead: Why should they respond?

What’s The Point?

People want to have their voices heard. The more voices there are in the crowd the harder it is to hear any one voice. Just because no-one is answering or responding to you today, or reading what you write today, or listening to your podcast today, doesn’t mean they won’t tomorrow. If you’re intent on being heard and you have something to say then stick with it. It took 4 years of blogging, 2 years of podcasting both of them on again and off again before any volume of people started listening to me. Even now my listenership/readership is relatively small compared to some in the tech-space-bubble-whatever-you-call-it and that’s perfectly okay.

The reason I’ve chosen to write this down (type this in? I guess) is I came across some people I admire (with small followings) on Twitter that expressed their anger and frustration with creating their own content and not being noticed. They wanted to be part of a conversation with others they respected on the internet but it wasn’t happening. That triggered my memory of how frustrated I used to feel years ago when no one was really listening to me. My recent interactions with people I’ve admired from afar got me thinking about what changed. I haven’t been annoyed or upset about it for years now - since well before Pragmatic and hence well before many people really paid attention to me. So what changed?

Do Good Work And You’ll Get Noticed?

This is where I lose people and we get the “privilege” accusation or maybe even an eye roll or ten. Why that happens is that I’ve lost track just how many times I’ve read and heard that sentiment. The problem is that the superficial interpretation of that sentiment is easily derided and the actual point is lost on a lot of people - myself included until the past year or two.

Of course if you’re not a narcissist perhaps it just doesn’t matter. I tend to think though that all people want is to be heard by somebody else and that alone does not qualify you as a narcissist1. How much energy you devote to starting a conversation with others is your own personal choice. All judgement aside, assuming you’ve made it this far, what’s the best approach?

If we assume that the people you want to notice your work have one minute each day to notice something new, and there are thousands of other people creating content just like yours, the moment when their eyes and your work align has to be some of your most impressive work or that moment will pass and you’ll be overlooked. The best approach is to simply keep at it and in time, eventually, people will notice. Maybe even the people you want to notice.

Perhaps then the expression should be: only put out your best work, tweets, blog posts, podcasts, software, graphical designs so that when your moment comes, the people you want to notice your work will see the best you have to offer. There’s still the possibility that the best you have to offer isn’t going to be good enough, but that’s really just a function of who you’re trying to impress. But once that moment happens, planets align, your work gets noticed, then the conversation can begin.

  1. Sorry Jordan.