Skip to content

Instantly share code, notes, and snippets.

@johnny13
Forked from anthonybudd/WP_Mail-basic-example.php
Created December 6, 2017 21:02
Show Gist options
  • Save johnny13/d177dc3e54105e9f36d9abbfc4b1f930 to your computer and use it in GitHub Desktop.
Save johnny13/d177dc3e54105e9f36d9abbfc4b1f930 to your computer and use it in GitHub Desktop.
<?php
$email = (new WP_Mail)
->to('john.doe@gmail.com')
->subject('WP_Mail is great!')
->template(get_template_directory() .'/emails/demo.html', [
'name' => 'John Doe',
'location' => 'London',
'link' => 'http://github.com/anthonybudd/WP_Mail'
])
->send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment