Skip to content

Instantly share code, notes, and snippets.

View ricocrivelli's full-sized avatar

Ricardo Crivelli ricocrivelli

View GitHub Profile
@ricocrivelli
ricocrivelli / emails.php
Created April 5, 2021 20:04 — forked from tameemsafi/emails.php
Send an email programmatically in wordpress with wp_mail using the woocommerce transaction emails template.
<?php
// Define a constant to use with html emails
define("HTML_EMAIL_HEADERS", array('Content-Type: text/html; charset=UTF-8'));
// @email - Email address of the reciever
// @subject - Subject of the email
// @heading - Heading to place inside of the woocommerce template
// @message - Body content (can be HTML)
function send_email_woocommerce_style($email, $subject, $heading, $message) {