It turns out, that you don’t notice emails aren’t coming, when you don’t actively look for them. Several days after the emails stopped being sent by the blog, the customer approached me in a fierce tone and asked, why they weren’t being sent.
This is rather typical, so I would like to guide you through the process. Something goes awry. By the time it goes wrong, it has already created some form of havoc. In most cases, the person that notices the problem will already have identified, considered and perhaps even attempted several ways to fix said problem. There were issues with the timing of emails in the past, due to the way the system works. Maybe if we just wait a day?
Suggesting one of the options that had been identified, considered and performed only worsened how the customer feels about the problem. Why am I paying this idiot (with love of course), if all suggestions are things I’ve tried already? What the customer rarely realizes, is that they had a lot more time to think about what’s bothering them and try things, due to the fact that they discovered the problem. Once it reaches a so-called expert, they are thrown into cold water.
Now I don’t want to bore you with technicalities, but I would like to try to sell the problem solving we “tech-savvy” people face every day, and show you it’s not so different from what you do as well.
When you write an email, you type some text into a program. In recent years, websites have been made which abstract this process (gmail, yahoo, etc.). For the newsletters to send, we don’t want to manually type in this text, but rather have it be sent, when and if it needs to be. It is a simple logic, which does this: our server (if you don’t know what it is: computer which runs this website) checks in a certain interval (daily) whether new posts have been released. If at least one new post fits that criteria, it makes a list of all of them and creates a “digest” email, where each post is teased. Due to the publishing schedule, it’s usually also only one post.
Once the email has been created, it begins to send it out to the recipients. It does so, by acting like a regular email client. Creating the text to send each person, connecting to the server (Google’s) which handles the mailing of each individual email.
Now since no emails came through, it allows for two major problems. Either the mails are not being created, or they aren’t being sent. Both of those result in several reasons why they might occur.
Luckily both are easy to check. The administration view of the website allows us to see, that the emails were being created. So we know it’s a problem with sending them. Luckily, there is a fantastically easy way to check that. There is a dedicated box to press: send test email. Trying that revealed something along the lines of “Authentication error. Could not connect to Server.” Now maybe I’m reaching here, but I bet even you could come up with some reasons why that may show up. Most likely you would think to check the password. It uses the same password as you normally need to enter to see your mail, so we checked that and it was fine. This meant it had to be something to do with the connection in general, since the credentials (username password combination) worked elsewhere.
You might think it’s rocket science, but it isn’t. The way to solve such a problem? See how other people solved it. Usually they have. I opened the search engine of my choice, and typed in my problem.
[name of newsletter plugin] gmail authentication error
https://www.google.com/search?q=mailpoet+gmail+authentication+error
Now all I do, is read. I look for problems that sound similar, and especially in the ones were a solution is presented. Thank you to those, which struggle with a problem and post not just a detailed description of the problem, but also helpful information which lead them to solve their problems.
In layman’s terms, Google just doesn’t allow the form of connecting anymore, which the newsletter plugin used. Essentially it was just entering a username and password, which was discontinued. Since it was too cumbersome to implement, the creators of the newsletter plugin discontinued support for this form of sending emails. We wanted to anyway.
Other plugins advertised that emails could indeed be sent to Google, implementing their new token based security. All you need to know, is that it uses a different method of securing the information exchanged. These plugins offered something wonderful: they capture any usage of the website-internal mailing function, and replace it with the improved one, which they can pass on to google. That sounds difficult. Think of it this way:
Mail gets delivered to a mailbox. The person that sends doesn’t need to know color or size of it, if it’s a reasonably shaped letter it (usually) gets to where it should go. What the plugin did, is nothing else but stealing mail. Now that might sound bad, but I would rather use the example encountered in New York recently. The kind folks living right next to us are getting to an age, where going out and getting the mail is getting more troublesome. It’s hard and exhausting for them to move, and when walking it’s nice not to have to hold envelopes and newspapers. To help them, our whole family has been picking up the mail from the mailbox, and dropping it inside their entrance hallway. We take things, that aren’t destined for us, do something with them, and deposit them elsewhere. Many parties of this system don’t have to deal with the change. People addressing the letters still write the same thing, and the postman delivers it into the same mailbox. Only the elderly couple doesn’t have to make the trip, and instead we do.
The same thing applies to the plugin. It takes anything that was to be sent, and securely connects to google in to send it. The ‘thing’ that was sending it, doesn’t even have to realize that something has changed. What we tried, is to intercept the attempt to send emails, and send it in a different way, which unlike the first would actually work now.
If that would have been all, it would have been done quickly. The next problem was the sending. The developers of the newsletter chose to take control of exactly how the mail was sent, rather than using the handy existing software. Consider the similarity being the next time you ask someone to run to the grocery store giving them not just a shopping list, but also a lecture on how to drive, detailed maps and instructions, as well as a lengthy weather report. Luckily during the development they had taken the care to prepare for the possibility to use the correct mail function, but had hidden it, visually. Luckily for me, others had found out and written about it, giving detailed instructions on how to “unlock” the “feature”. So now the newsletter plugin was modified, in order to send mails in a way that are not intended, only for those mails to be captured by a different plugin, which would then send them in a way that actually worked. Sounds simple enough right? Well the result of all of this was what was “garbled code” in the recent post. It wasn’t really garbled, in fact it was exactly what it was supposed to be, it was just called the wrong thing. Let me give another analogy. If you speak French beautifully, but then speak your eloquent French to someone you hired to translate Chinese into English, you are going to have a bad time (unless the translator just happens to know French as well, humans are a little more tolerant). The same thing was happening with the emails. It contained all the formatting which normally displays the email with color, spacing and links, and served it as simple text. Only a slight problem, scientifically, but one that still rendered it rather useless to you, our kind audience, and I apologize profusely.
You see, if you remember the little button, which I talked about earlier. The one to send a test email? I used that, to check that everything worked. And it did! However, the email it sends, is one that only contains simple text (a text message like “It works!”). Therefore, I was unable to realize, that once the formatted email would be sent in the same way, it wouldn’t be nearly as successful. This may actually be why the developers hid the function in the first place, but it left me having once again break into the existing code, add in a statement about it being formatted and not just plaintext, and trying again.
The result has been working successfully thus far.
I realize you may still the people that write code are all crazy people, fit for the looney bin. But maybe I was able to show that the things we do, the problems we solve and the way that changing one part doesn’t mean everything else needs to change, can be seen and have been solved by people even when dealing with traditionally non-technological problems.
Also Happy Easter, if you celebrate, otherwise happy day off!