updated to 0.9.2

git-svn-id: https://plugins.svn.wordpress.org/send-email-from-admin/trunk@1278861 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
kojak711 2015-11-03 18:24:47 +00:00
parent 9cd81782a3
commit 35848cd509
2 changed files with 28 additions and 20 deletions

View File

@ -1,10 +1,10 @@
=== Send Email From Admin ===
Contributors: kojak711
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8HHLL6WRX9Z68
Tags: email, send email, admin email, custom email, email tools
Tags: email, send email, admin email, custom email, email tools, email attachment
Requires at least: 4.0
Tested up to: 4.3.1
Stable tag: 0.9.1
Stable tag: 0.9.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -12,7 +12,7 @@ Easily send a simple custom email with an attachment from the WordPress administ
== Description ==
Send Email From Admin gives you the ability to easily send a custom HTML email from the WordPress administration screen. You can send to existing users or add your own recipients. You can send to multiple recipients and choose to send group emails or individual emails. Emails can also have an attachment. A new menu item called 'Send Email' is added under the Tools menu.
Send Email From Admin gives you the ability to easily send a custom HTML email from the WordPress administration screen. You can send to existing users or add your own recipients. You can send to multiple recipients and choose to send group emails or individual emails. Emails can also have an attachment. A new menu item called 'Send Email' is added under the Tools menu. This plugin is also translatable.
== Installation ==
@ -43,6 +43,11 @@ Yes. You can upload and attach one attachment to the email message.
== Changelog ==
= 0.9.2 =
* minor code cleanup
* added HTML5 'required' attribute to form fields
* js and css now only load on SEFA admin page
= 0.9.1 =
* css and html cleanup
* added mail dashicon

View File

@ -3,7 +3,7 @@
Plugin Name: Send Email From Admin
Plugin URI:
Description: Easily send a simple custom email with an attachment from the WordPress administration screen. Tools -> Send Email.
Version: 0.9.1
Version: 0.9.2
Author: kojak711
Domain Path: /languages
Text Domain: sefa
@ -29,27 +29,30 @@ if ( ! defined( 'ABSPATH' ) ) {
}
define( 'SEFA_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
define( 'SEFA_PLUGIN_VER', '0.9.2' );
/**
* Add our sub menu in the Tools menu
*
* @since 0.9
* @since 0.9.2
*/
function sefa_plugin_admin_menu() {
add_submenu_page( 'tools.php', 'Send Email From Admin', 'Send Email', 'manage_options', 'sefa_email', 'sefa_plugin_main' );
function sefa_plugin_add_admin_page() {
// create sefa submenu page under the Tools menu
$sefa_page = add_submenu_page( 'tools.php', 'Send Email From Admin', 'Send Email', 'manage_options', 'sefa_email', 'sefa_plugin_main' );
// load js and css on sefa page only
add_action( 'load-' . $sefa_page, 'sefa_plugin_scripts' );
}
add_action( 'admin_menu', 'sefa_plugin_admin_menu' );
add_action( 'admin_menu', 'sefa_plugin_add_admin_page' );
/**
* Load our css and js.
*
* @since 0.9
* @since 0.9.2
*/
function sefa_plugin_init() {
wp_enqueue_style( 'sefa_admin_css', SEFA_PLUGIN_DIR_URL . '/css/sefa.css' );
wp_enqueue_script( 'sefa_admin_js', SEFA_PLUGIN_DIR_URL . '/js/sefa.js', array('jquery'));
function sefa_plugin_scripts() {
wp_enqueue_style( 'sefa_admin_css', SEFA_PLUGIN_DIR_URL . 'css/sefa.css', '', SEFA_PLUGIN_VER );
wp_enqueue_script( 'sefa_admin_js', SEFA_PLUGIN_DIR_URL . 'js/sefa.js', array('jquery'), SEFA_PLUGIN_VER);
}
add_action( 'admin_enqueue_scripts', 'sefa_plugin_init' );
/**
* Register our text domain.
@ -175,11 +178,11 @@ function sefa_plugin_main() {
?>
<tr>
<th scope=”row”>From:</th>
<td><input type="text" disabled value="<?php echo "$from_name &lt;$from_email&gt;"; ?>"><div class="note"><?php _e( 'These can be changed in Settings->General.', 'sefa' ); ?></div></td>
<td><input type="text" disabled value="<?php echo "$from_name &lt;$from_email&gt;"; ?>" required><div class="note"><?php _e( 'These can be changed in Settings->General.', 'sefa' ); ?></div></td>
</tr>
<tr>
<th scope=”row”><label for="sefa-recipient-emails">To:</label></th>
<td><input type="email" multiple id="sefa-recipient-emails" name="sefa_recipient_emails" value="<?php echo esc_attr( sefa_plugin_issetor($sefa_recipient_emails) ); ?>"><div class="note"><?php _e( 'To send to multiple recipeints, enter each email address seperated by a comma or choose from the user list below.', 'sefa' ); ?></div>
<td><input type="email" multiple id="sefa-recipient-emails" name="sefa_recipient_emails" value="<?php echo esc_attr( sefa_plugin_issetor($sefa_recipient_emails) ); ?>" required><div class="note"><?php _e( 'To send to multiple recipeints, enter each email address seperated by a comma or choose from the user list below.', 'sefa' ); ?></div>
<select id="sefa-user-list">
<option value="">-- <?php _e( 'user list', 'sefa' ); ?> --</option>
<?php
@ -200,19 +203,19 @@ function sefa_plugin_main() {
<th scope=”row”></th>
<td>
<div class="sefa-radio-wrap">
<input type="radio" class="radio" name="sefa_group_email" value="no" id="no" checked>
<input type="radio" class="radio" name="sefa_group_email" value="no" id="no" required>
<label for="no"><?php _e( 'Send each recipient an individual email', 'sefa' ); ?></label>
</div>
&nbsp;&nbsp;
<div class="sefa-radio-wrap">
<input type="radio" class="radio" name="sefa_group_email" value="yes" id="yes"<?php if ( isset($sefa_group_email) && $sefa_group_email === 'yes' ) echo ' checked'; ?>>
<input type="radio" class="radio" name="sefa_group_email" value="yes" id="yes"<?php if ( isset($sefa_group_email) && $sefa_group_email === 'yes' ) echo ' checked'; ?> required>
<label for="yes"><?php _e( 'Send a group email to all recipients', 'sefa' ); ?></label>
</div>
</td>
</tr>
<tr>
<th scope=”row”><label for="sefa-subject">Subject:</label></th>
<td><input type="text" id="sefa-subject" name="sefa_subject" value="<?php echo esc_attr( sefa_plugin_issetor($sefa_subject) );?>"></td>
<td><input type="text" id="sefa-subject" name="sefa_subject" value="<?php echo esc_attr( sefa_plugin_issetor($sefa_subject) );?>" required></td>
</tr>
<tr>
<th scope=”row”><label for="sefa_body">Message:</label></th>
@ -229,7 +232,7 @@ function sefa_plugin_main() {
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" value="<?php _e( 'Send Message', 'sefa' ); ?>" name="submit" class="button button-primary">
<input type="submit" value="<?php _e( 'Send Email', 'sefa' ); ?>" name="submit" class="button button-primary">
</td>
</tr>
</table>