Send Emails through WordPress with wp_mail

Standard

This handy function allows you to tell WP to send email. I’m using it to send emails requesting feedback on a customer service site. Its implementation is surprisingly simple.

<?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?>

I created an action that hooked into save_post, and when the post (a support ticket) is updated to “closed” (a custom taxonomy), an email will be sent. It’s amazingly easy.

wp_mail from the WordPress Codex.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s