4f4cd750 by Kevin Burton

updated notification file to allow email address to be passed through args if new register

1 parent 37b90785
......@@ -488,7 +488,7 @@ input.dp-applied {
.cbv-report-list tbody td { text-align:left; font-size: 11px; word-wrap: normal; padding: 3px 5px; }
.cbv-report-list tbody tr.odd td { background-color: #f5f5f5; }
.cbv-report-list thead th { background-color: #e1e1e1;border-bottom:1px solid #e8e8e8; }
.cbv-report-list tbody td { border-bottom:1px solid #e8e8e8; min-width: 120px;}
.cbv-report-list tbody td { border-bottom:1px solid #e8e8e8; min-width: 120px; background-color:#fff;}
#user-list-from { display: block; }
......
<?php
namespace Tz\WordPress\Tools\MySQLTable;
function array2table($arr,$width)
function array2table($arr,$width = "100%")
{
$count = count($arr);
if($count > 0){
......
......@@ -187,7 +187,7 @@ function remove_notice($notification_id = -1) {
Send Notifications
@trigger = notification unique slug name
*/
function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(),$send_override = false) {
function send_triggered_notification($uid = 0,$trigger="NO_TRIGGER",$args = array(),$send_override = false) {
global $wpdb;
$notification = get_notification_by_trigger($trigger);
......@@ -231,8 +231,13 @@ function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(),
// if is_email ===========================================
if ($notification->is_email) {
$user = new User\Account($uid);
if ($uid == 0 && !isset($args['email'])) {
return;
} elseif ( $uid == 0 && isset($args['email']) ) {
$to_email = $args['email'];
} else {
$user = new User\Account($uid);
$email_address_preference = get_user_meta($user->ID, 'email_address_preference', true);
if (empty($email_address_preference)) {
$to_email = $user->user_email;
......@@ -245,6 +250,7 @@ function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(),
$to_email = $user->user_email;
}
}
}
$contents = $email;
......