updated notifications to use the WP user_email
Showing
1 changed file
with
6 additions
and
2 deletions
| ... | @@ -177,6 +177,8 @@ function remove_notice($notification_id = -1) { | ... | @@ -177,6 +177,8 @@ function remove_notice($notification_id = -1) { |
| 177 | @trigger = notification unique slug name | 177 | @trigger = notification unique slug name |
| 178 | */ | 178 | */ |
| 179 | function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(),$send_override = false) { | 179 | function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(),$send_override = false) { |
| 180 | |||
| 181 | |||
| 180 | $notification = get_notification_by_trigger($trigger); | 182 | $notification = get_notification_by_trigger($trigger); |
| 181 | if($notification) { | 183 | if($notification) { |
| 182 | 184 | ||
| ... | @@ -186,7 +188,7 @@ function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(), | ... | @@ -186,7 +188,7 @@ function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(), |
| 186 | $notify_me = get_user_meta($user->ID,'notify_me',true); | 188 | $notify_me = get_user_meta($user->ID,'notify_me',true); |
| 187 | $notify_format = get_user_meta($user->ID,'notify_format',true); | 189 | $notify_format = get_user_meta($user->ID,'notify_format',true); |
| 188 | $email_preference = get_user_meta($user->ID,'email_address_preference',true); | 190 | $email_preference = get_user_meta($user->ID,'email_address_preference',true); |
| 189 | $cell = get_user_meta($user->ID,'home_mobile',true); | 191 | $cell = get_user_meta($user->ID,'mobile',true); |
| 190 | } | 192 | } |
| 191 | 193 | ||
| 192 | // get the notification and notificatio details.... | 194 | // get the notification and notificatio details.... |
| ... | @@ -248,8 +250,9 @@ function send_email($uid, $contents,$args) { | ... | @@ -248,8 +250,9 @@ function send_email($uid, $contents,$args) { |
| 248 | 250 | ||
| 249 | if ($uid > 0) { | 251 | if ($uid > 0) { |
| 250 | $user = new WP_User($uid); | 252 | $user = new WP_User($uid); |
| 253 | $to_email = $user->user_email;//get_user_meta($uid,'home_email',true); | ||
| 251 | 254 | ||
| 252 | 255 | /* | |
| 253 | $preference = get_user_meta($uid, 'email_address_preference',true); | 256 | $preference = get_user_meta($uid, 'email_address_preference',true); |
| 254 | 257 | ||
| 255 | if ($preference == "Home") { | 258 | if ($preference == "Home") { |
| ... | @@ -263,6 +266,7 @@ function send_email($uid, $contents,$args) { | ... | @@ -263,6 +266,7 @@ function send_email($uid, $contents,$args) { |
| 263 | if (!(boolean)filter_var($to_email, FILTER_VALIDATE_EMAIL)) { | 266 | if (!(boolean)filter_var($to_email, FILTER_VALIDATE_EMAIL)) { |
| 264 | $to_email = $user->user_email; | 267 | $to_email = $user->user_email; |
| 265 | } | 268 | } |
| 269 | */ | ||
| 266 | 270 | ||
| 267 | 271 | ||
| 268 | 272 | ... | ... |
-
Please register or sign in to post a comment