Masahiko Sunami

Author Archives: mas

Integrating Contact Form 7 with iContact

iContact

Here is another post on integrating Contact Form 7 WordPress plugin to an email marketing service which I did for my recent client – this time with iContact. There are few ways to use iContact API, but I chose to use send HTTP post with json encoding. A convenient built-in WordPress function makes it relatively straightforward.

Happy coding!

Register your App

First, you need to create and register an application for your iContact account. Follow the steps outlined here. You can create a sandbox account if you want to test the integration before you apply it to your active lists. In either case, you will need the following information:

API Username (If using sandbox, this is a username for your sandbox account) Application ID Application Password API URL (you will see this under Account Information when you set your application password. It should look like this: https://app.icontact.com/icp/a/123456/c/78901/) Find List ID

You need a numeric ID for the list that ...

Continue reading »

Responsive Web Design: Designing a Website for Mobile Devices

Designing for Mobile Devices

I created a post a while ago, that captures user agent string to determine device width, height and aspect ratio of different mobile devices. The idea was to get a sense of those specs to assist me in making my site responsive to mobile devices. You can see if you access this site from a mobile device, or adjust your browser window size if you are on a computer, that my site layout changes to accommodate different screen sizes. Responsive web design is a big thing now, that more and more people are accessing the web using mobile devices, every website should be optimized to accommodate smaller screen size, even if it’s a fixed width design. So here are my notes on how to go about it.

1. Viewport meta tag in HTML header

Viewport is basically an effective screen size for a mobile device. By using a special meta tag in ...

Continue reading »

Integrating Contact Form 7 to MailChimp – the Better Way

Freddie

Recently, I had to figure out how to integrate excellent Contact Form 7 plugin for WordPress to a MailChimp list, so when someone uses the contact form on the site, his/her name and email address are added to MailChimp list. I thought it won’t be that hard to find the answer, since MailChimp offers an array of API calls, but to the contrary, my search didn’t really get me what I was looking for, so now that I figured it out, I thought I’d put it out there for others to use.

My initial search yielded this post, suggesting that I modify the Contact Form 7 code itself, which is what I definitely didn’t want to do. I also found this post which talks about using wpcf7_mail_sent action hook to send form data to a custom database. So with some reference to the MailChimp listSubscribe API, I came up with a ...

Continue reading »

List of Mobile Device User Agents, Screen Sizes, and Pixel Aspect Ratio

In an effort to get a sense of device width, height, and pixel aspect ratio of various mobile devices out there, I decided to spend a day wrestling with JavaScript and PHP to create a page that records visitor’s user agent and device information. It took some doing, but I ended up with this page, which records your User Agent, Device Width, Device Height, Pixel Aspect Ratio, and Device Orientation if same spec doesn’t already exist in the database. Your device information and table of collected data are displayed below.

I am separating the list of mobile devices from PC’s by seeing if device orientation is defined or not. (Orientation is 0 for portrait, 90/-90 for landscape,  or “undefined”.) You should be able to get a sense of what each devices are, by looking at user agents (iPhone, iPad, Android, etc…), but same device with different OS versions will also record ...

Continue reading »

Most Essential WordPress Plugins

Plug In!

From my experience as a WordPress theme developer, I believe that you need to use as few plugins as you can, to keep your site lightweight and fast. Of course, the plugins that you use should be well written and lightweight as well. So if I need more functionality, I usually just code it into my theme functions.php file; It’s relatively straight forward and you can really dial in the code to suit exactly what you need.

Having said that, there are number of plugins that I rely on for almost every site I create. These plugins offer functionality that are otherwise too hard to implement and maintain, are all relatively lightweight, well written, have good support, and they are all FREE! I hope that you find it useful, and feel free to comment if I think I missed something.

By the way, I don’t use plugins for integrating social media, such ...

Continue reading »

« Older posts