1 | <?php |
---|
2 | /** |
---|
3 | * @package WP_Test_HTML_Email |
---|
4 | * @version 1.0 |
---|
5 | */ |
---|
6 | /* |
---|
7 | Plugin Name: WP Test HTML Email |
---|
8 | Plugin URI: http://wordpress.org/extend/plugins/wp-test-html-email/ |
---|
9 | Description: This is just a demo plugin for core ticket |
---|
10 | Author: Umesh Kumar |
---|
11 | Version: 1.0 |
---|
12 | Author URI: http://codechutney.com |
---|
13 | */ |
---|
14 | function wp_test_html_email() { |
---|
15 | $content = __( "<br /> <b>Content being sent: </b>Payment Amount: €2.00 EUR" ); |
---|
16 | print_r( $content ); ?> |
---|
17 | <br/><br/> |
---|
18 | <form method="post"> |
---|
19 | <label>Email:<input type="text" name="test_email" value=""/></label> |
---|
20 | <input type="submit" name="wp_send_test_email" id="wp_send_test_email" class="button button-primary button-large" value="Send test email"> |
---|
21 | </form> |
---|
22 | <?php |
---|
23 | if ( $_POST['wp_send_test_email'] && !empty($_POST['test_email']) ) { |
---|
24 | $mail = wp_mail( $_POST['test_email'], "Test Email", $content ); |
---|
25 | if( $mail ) { |
---|
26 | echo "Email sent to: " . $_POST['test_email'] ; |
---|
27 | } |
---|
28 | } |
---|
29 | } |
---|
30 | |
---|
31 | function wp_test_html_email_page() { |
---|
32 | add_management_page( "Euro sign converted to Emoji URL", "Test HTML Email", 'manage_options', 'wp-test-html-email', "wp_test_html_email" ); |
---|
33 | } |
---|
34 | |
---|
35 | add_action( 'admin_menu', 'wp_test_html_email_page' ); |
---|
36 | add_filter( 'wp_mail_content_type', 'set_content_type' ); |
---|
37 | function set_content_type( $content_type ) { |
---|
38 | return 'text/html'; |
---|
39 | } |
---|
40 | |
---|
41 | ?> |
---|