Skip to main content

Mymail | Wordpress

?> <div class="wrap"> <h1>MyMail Newsletter</h1> <h2>Subscribers (<?php echo count($subscribers); ?>)</h2> <ul> <?php foreach ($subscribers as $sub): ?> <li><?php echo esc_html($sub->email); ?> (<?php echo esc_html($sub->name); ?>)</li> <?php endforeach; ?> </ul>

add_action('init', 'mymail_handle_subscription'); Add this to send emails to all subscribers from WordPress admin:

require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); add_action('after_switch_theme', 'mymail_create_table'); // Shortcode: [mymail_form] function mymail_subscription_form() ob_start(); ?> <form method="post" class="mymail-form"> <input type="email" name="mymail_email" placeholder="Your email address" required> <input type="text" name="mymail_name" placeholder="Your name (optional)"> <input type="submit" name="mymail_subscribe" value="Subscribe"> <?php wp_nonce_field('mymail_subscribe_action', 'mymail_nonce'); ?> </form> <?php return ob_get_clean();

Savory Fund
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.