Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
Tz Tools
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
86d049f3
authored
2011-04-12 13:28:34 +0000
by
Kevin Burton
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
merged 220 into tag
1 parent
f3eb8d8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
com/Notifications/Notifications.php
com/Notifications/Notifications.php
View file @
86d049f
...
...
@@ -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,19 +231,25 @@ function send_triggered_notification($uid,$trigger="NO_TRIGGER",$args = array(),
// if is_email ===========================================
if
(
$notification
->
is_email
)
{
$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
;
if
(
$uid
==
0
&&
!
isset
(
$args
[
'email'
]))
{
return
;
}
elseif
(
$uid
==
0
&&
isset
(
$args
[
'email'
])
)
{
$to_email
=
$args
[
'email'
];
}
else
{
$pp
=
strtolower
(
$email_address_preference
)
.
"_"
;
$to_email
=
get_user_meta
(
$user
->
ID
,
$pp
.
'email'
,
true
);
if
(
empty
(
$to_email
))
{
$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
;
}
}
else
{
$pp
=
strtolower
(
$email_address_preference
)
.
"_"
;
$to_email
=
get_user_meta
(
$user
->
ID
,
$pp
.
'email'
,
true
);
if
(
empty
(
$to_email
))
{
$to_email
=
$user
->
user_email
;
}
}
}
$contents
=
$email
;
...
...
Please
register
or
sign in
to post a comment