Hi,
You can read here what filters are exactly and how to use them in your code. To help you on your way, we have made the following example:
<?php
add_filter( 'dae_email_message', 'my_content_email_message', 10, 5 );
function my_content_email_message( $message, $values, $email_content, $file, $download_url ) {
if ( 'new.txt' == $file ) {
$message = '
<h1>This is the title</h1>
<p>This is a paragraph...you can use a placeholder like this: {email}</p>
<p>You can find your Free Download here: <a href="{download_url}">Example-1</a></p>
';
}
if ( 'old.txt' == $file ) {
$message = '
<h1>This is the title</h1>
<p>This is a paragraph...</p>
<p>You can find your Free Download here: <a href="{download_url}">Example-2</a></p>
';
}
return $message;
}
?>
You can add the code to your theme’s functions.php or to your custom plugin. It is recommended that you always test your code before using it on a live site.
Kind regards,
Team Download After Email
thank you very much , may I ask: if ( ‘new.txt’ == $file ) , ‘new.txt’ and ‘old.txt’ is it default or can I change it to any value, What is a complete and correct code for the example below, thank you
View post on imgur.com
-
This reply was modified 4 years, 9 months ago by
voviet1591.
You are welcome. To make your code complete/working, you need to replace the example file names (new.txt and old.txt) and adjust the content (HTML code) of the messages to your needs.
Kind regards,
Team Download After Email