Skip to content

Instantly share code, notes, and snippets.

@jbrunemann
Last active May 17, 2017 07:26
Show Gist options
  • Save jbrunemann/56e423b3228d3c2b1515fadb3d4c4a20 to your computer and use it in GitHub Desktop.
Save jbrunemann/56e423b3228d3c2b1515fadb3d4c4a20 to your computer and use it in GitHub Desktop.
wp_mail to console
<?php
function wp_mail($to, $subject, $message) {
$stdout = fopen('php://stdout', 'w');
$output = str_repeat('-', 70)."\n\033[94mTO\e[0m: \033[96m{$to}\e[0m\n\033[94mSUBJECT\e[0m: \033[96m{$subject}\e[0m\n{$message}\n".str_repeat('-', 70)."\n";
fwrite($stdout, $output);
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment