Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Automating HTML email with WordPress

From: Effective HTML Email and Newsletters

Video: Automating HTML email with WordPress

Having discussed concepts, let's look at using WordPress to automate the creation of emails. To automate email newsletters with WordPress, we will follow these steps. We will create a category called Newsletter, and we will get the ID. We will create posts, tag each post with the Newsletter category, and add custom fields, two of them: one called explore link icon and the other, image thumbnail. Third, we will create a template with the name Email Newsletter. We will use query_post to display their most recent entries tagged with category Newsletter.

Automating HTML email with WordPress

Having discussed concepts, let's look at using WordPress to automate the creation of emails. To automate email newsletters with WordPress, we will follow these steps. We will create a category called Newsletter, and we will get the ID. We will create posts, tag each post with the Newsletter category, and add custom fields, two of them: one called explore link icon and the other, image thumbnail. Third, we will create a template with the name Email Newsletter. We will use query_post to display their most recent entries tagged with category Newsletter.

And finally, we will create a page, we will assign the template Email Newsletter to that page, and we will publish. Let's look at each of these steps now. The first step is to create a category called Email or Email Newsletter. In this case we've used the phrase Email Newsletter. If we click the Email Newsletter link, we see the Edit Category page, and up in the URL there is a value call tag_ID =3. This is WordPress's unique ID for this category. We will need this later when we code or template. For now, let's remember the ID for this category is 3.

The second step will be to create a post. We have a post here, Cycle California Tours, and if you recall, this is the two- column email that we will automate, and we had, for each tour, a logo, a description, and a link to explore more information about that tour. Now, we will replicate that a little bit. We will create a post for the Cycle Tour. Once we have our copy in the Edit box, then we go over to Categories, we select the Email Newsletter, we scroll down, and we create two custom fields. One is called to EXPLORE Link Icon, and that refers to the EXPLORE Link with the little start.

The stars are either blue or red or gray. In this case, our Custom Field, explore link icon, we'll choose red. The second Custom Field we add is Image Thumbnail. This corresponds to the Cycle Tours logo here. To get the value for the image thumbnail, we upload the image using WordPress's Add an Image pop-up. Since we've already added it, it's in our gallery. There is the logo. We scroll down.

We look for the link URL. We highlight it, Copy, close Add an Image pop-up, scroll down, and now we have a value for our image thumbnail Custom Field, and we click Update. So now we have a post that is one tour description with its logo image and a choice of explore button. We've also tagged it with the Email Newsletter category, and we've added to custom fields, one to define the explore button we want and the other to define the thumbnail logo that we want to use.

The next step is to work on the template. If you recall, our category ID was the number 3. So when we scroll down, in PHP we are using the query_posts function. We use showposts. We want four posts. If you recall our original email, we had one, two, three, and four tours, so we have four posts. Our category ID is the number 3, which we retrieved earlier. The next thing in our code does is retrieve the custom field for image thumbnail.

We've typed in here the custom field name as it appeared on the post form we saw moment ago. We retrieved the explorer icon, which works exactly the same way as the image thumbnail. You type in the custom field name as it appears on the post form. Then we retrieve the excerpt, and because the excerpt comes packaged with a paragraph tag, HTML p tag, before and after the excerpt, we need to remove that, because in our HTML email, it will mess up our formatting. Once we have our image thumbnail, then we build the actual image code for our logos.

Then we use a custom field to define the explore button to define which image to call. In this case, it's red, so we know that the explore red button will appear. Finally, we have one instance of our table that contains tour logo, the tour description, and the explore link. And within this one instance, we have PHP code to display the thumbnail at the right spot, display the tour description as an excerpt at the right spot, and then the permaLink at the right spot.

Finally, with our template, so that we can find it with the page, at the very top of the template we define the template name as Email Newsletter. The last step is to create a page. We have a page called Newsletter. When we open it, we have selected a template over here on the right called Email Newsletter, and when we update it, you see that we have automated the two-column HTML email with WordPress using the first post. If you want to see a little bit about how this works, we will go back to our post.

We will use the blue explorer icon. We will update it, update our post. Now we have the red explorer icon. Now we have the blue. This video only shows a general way to automate the creation of emails with WordPress. You will to need to refer to other online documentation for the software if you want or need more technical details.

Show transcript

This video is part of

Image for Effective HTML Email and Newsletters
Effective HTML Email and Newsletters

55 video lessons · 23009 viewers

Tim Slavin
Author

 
Expand all | Collapse all
  1. 2m 25s
    1. Welcome
      1m 1s
    2. Using the exercise files
      1m 24s
  2. 13m 12s
    1. Understanding differences between HTML email and web pages
      1m 21s
    2. Seeing how HTML email displays in different email programs
      3m 27s
    3. Finding Acid tests and compatibility checklists
      2m 35s
    4. Understanding MIME types: HTML vs plain text
      4m 3s
    5. Exploring the future of HTML email
      1m 46s
  3. 15m 12s
    1. Defining spam
      2m 6s
    2. Examining legal issues with permission-based email
      1m 33s
    3. Planning email campaigns
      1m 36s
    4. Creating content for email campaigns
      2m 34s
    5. Understanding design constraints of HTML email
      1m 53s
    6. Designing effective HTML email
      2m 5s
    7. Building email address lists
      3m 25s
  4. 7m 28s
    1. Choosing tools for coding HTML email
      1m 27s
    2. Coding email versus coding web pages
      1m 14s
    3. Preventing problems with email coding
      2m 49s
    4. Understanding the ideal coding process
      1m 58s
  5. 17m 27s
    1. Planning
      1m 8s
    2. Coding HTML tables
      4m 38s
    3. Adding content
      4m 49s
    4. Adding inline CSS
      6m 52s
  6. 10m 44s
    1. Planning
      43s
    2. Coding HTML tables
      2m 41s
    3. Adding content
      3m 39s
    4. Adding inline CSS
      3m 41s
  7. 13m 13s
    1. Planning
      1m 13s
    2. Coding HTML tables
      3m 4s
    3. Adding content
      2m 37s
    4. Adding images
      1m 9s
    5. Adding inline CSS
      5m 10s
  8. 7m 32s
    1. Designing a plain text email
      4m 49s
    2. Designing a plain text email from an HTML email
      2m 43s
  9. 20m 45s
    1. Automating HTML email creation
      2m 5s
    2. Automating HTML email by category
      1m 6s
    3. Automating HTML email with WordPress
      5m 32s
    4. Automating HTML email with ExpressionEngine
      4m 27s
    5. Automating HTML email with FeedBurner from an RSS feed
      4m 27s
    6. Automating HTML email with FeedBlitz from an RSS feed
      3m 8s
  10. 6m 42s
    1. Deciding when and how to test email
      3m 18s
    2. Using testing services
      3m 24s
  11. 13m 56s
    1. Outsourcing your email campaign
      56s
    2. Sending email with MailChimp
      2m 40s
    3. Sending email with Campaign Monitor
      1m 51s
    4. Sending email with Constant Contact
      2m 20s
    5. Sending email with iContact
      2m 9s
    6. Sending email with VerticalResponse
      1m 52s
    7. Sending email with canned templates
      2m 8s
  12. 14m 34s
    1. Solving layout and spacing problems
      2m 50s
    2. Solving image problems
      3m 12s
    3. Solving Gmail display problems
      2m 19s
    4. Solving Lotus Notes display problems
      1m 55s
    5. Solving Outlook 2007/2010 display problems
      2m 40s
    6. Adding video to email
      1m 38s
  13. 1m 36s
    1. Next steps
      1m 36s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Effective HTML Email and Newsletters.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.