• wp_mail_from_name is a filter that we can use to define the person's from, rather than using the $headers array • wp_login is the hook that we'll use for demonstration such that we're sending emails to a person whenever a person logs into the WordPress dashboard For the sake of completeness, I'll share the whole code below and then we'll walk through it. ### The Source Code If you've been following along with this article thus far, then none of this should be terribly surprising: After all, we're taking advantage of the hooks that WordPress provides, we're building strings to pass as function arguments, and then we're calling the wp_mail function. Notice however, that we are passing an empty array as the $headers argument for this email. This is because we're using a custom filter to set the "From Name" and the "From Address" using a filter and a hooked function rather than an array.

This way isn't necessarily better than the alternative; however, it's meant to demonstrate that there are multiple ways to achieve the same result.

## And Now, on to Data!

So this is yet another feature of WordPress that makes it really easy to include email functionality into your web application.

In fact, I think WordPress' eventing model makes it ridiculously easy to introduce email functionality for just about any scenario imaginable - if there's a hook available for it, an email can be sent.

With that said, it's time to turn our attention to one of the most common aspects of web application development: data management.

Specifically, we need to look at how information can be saved to the database and retrieved from the data, and how it can be done so safely and efficiently.

So starting in the next article, we'll do exactly that.