$notify_to = $settings['notify_to'];
$notify_from = $settings['notify_from'];
$notify_message = $settings['notify_message'];
+ if ( !$notify_to ) {
+ return false;
+ }
// Setup the Smarty Engine
$smarty = new smartyTemplateSupport();
$namesList = false;
$enable_members = $this->config['settings']['enable_members'];
+ // Load Notifications from the helper classes
include_once GLM_MEMBERS_COUPONS_PLUGIN_CLASS_PATH . '/helper/notification.php';
$notification = new GlmMembersAdmin_coupon_notification( $this->wpdb, $this->config );
if ( $coupon ) {
$this->couponID = $coupon['fieldData']['id'];
$this->updateCategories();
- $categories = $Categories->getList(false);
+ $categories = $Categories->getList( false );
- if ($coupon['status']) {
+ if ( $coupon['status'] ) {
$haveCoupon = true;
$couponAdded = true;
// Update created timestamp and name slug for URLs
- $this->updateTimestamp('created', $this->couponID);
- $this->updateSlug($this->couponID);
+ $this->updateTimestamp( 'created', $this->couponID );
+ $this->updateSlug( $this->couponID );
// Get this again so we have the created date
- $coupon = $this->editEntry($this->couponID);
+ $coupon = $this->editEntry( $this->couponID );
$option = 'edit';
$couponAdded = true;
if ( $lockedToMember ) {
- if ( isset( $_REQUEST['ref_dest'] ) && $member_id = filter_var( $_REQUEST['ref_dest']) ) {
- $notification->sendAdminNotice( $member_id, $coupon);
+ if ( isset( $_REQUEST['ref_dest'] ) && $member_id = filter_var( $_REQUEST['ref_dest'] ) ) {
+ $notification->sendAdminNotice( $member_id, $coupon );
}
}