Skip to content

Instantly share code, notes, and snippets.

@tribulant
Created September 12, 2014 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tribulant/a0a858de93f37cbbee42 to your computer and use it in GitHub Desktop.
Save tribulant/a0a858de93f37cbbee42 to your computer and use it in GitHub Desktop.
Newsletters: Filter - wpml_send_body Example
<?php
add_filter('wpml_send_body', 'myfunc_send_body', 10, 3);
function myfunc_send_body($body = null, $phpmailer = null, $history_id = null) {
// Do something with the body/content here...
// For example, strip the HTML from it and assign it as the alternative body
$phpmailer -> AltBody = strip_tags($body);
// Or append something to it like social media icons at the end
$body .= '<div>Social media HTML</div>';
return $body;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment