aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-01-25 12:10:45 +0100
committerKevin Jardine <kevinjardine@yahoo.com>2012-01-25 12:10:45 +0100
commit2a3e34d1c5724b29a4f2404081f30b425fcdee50 (patch)
treedd00b1525ec9ee44cebc7b4fef3b0152b32c3438 /actions
parenta62fc25059fb7b67358b285b6d6f3a4a469f35bb (diff)
downloadelgg-2a3e34d1c5724b29a4f2404081f30b425fcdee50.tar.gz
elgg-2a3e34d1c5724b29a4f2404081f30b425fcdee50.tar.bz2
more for add_users and add_users_notify features
Diffstat (limited to 'actions')
-rw-r--r--actions/event_calendar/manage_subscribers.php2
-rw-r--r--actions/event_calendar/toggle_personal_calendar.php9
2 files changed, 10 insertions, 1 deletions
diff --git a/actions/event_calendar/manage_subscribers.php b/actions/event_calendar/manage_subscribers.php
index d20c73cbd..079c3628f 100644
--- a/actions/event_calendar/manage_subscribers.php
+++ b/actions/event_calendar/manage_subscribers.php
@@ -15,7 +15,7 @@ if (($event_calendar_add_users == 'yes') && elgg_instanceof($event,'object','eve
$subject = elgg_echo('event_calendar:add_users_notify:subject');
$user = get_user($user_guid);
$message = elgg_echo('event_calendar:add_users_notify:body',array($user->name,$event->title,$event->getURL()));
- notify_user($user_guid, $site_guid, $subject, $message);
+ notify_user($user_guid, $site_guid, $subject, $message, NULL, 'email');
}
}
system_message(elgg_echo('event_calendar:manage_subscribers:success'));
diff --git a/actions/event_calendar/toggle_personal_calendar.php b/actions/event_calendar/toggle_personal_calendar.php
index 9ad8d0a0e..8eb20e6b9 100644
--- a/actions/event_calendar/toggle_personal_calendar.php
+++ b/actions/event_calendar/toggle_personal_calendar.php
@@ -19,6 +19,15 @@ if (event_calendar_has_personal_event($event_guid,$user_guid)) {
$response = array('success'=>TRUE, 'message' => $remove_response, 'button_text'=>$button_text);
} else {
if (event_calendar_add_personal_event($event_guid,$user_guid)) {
+ $event_calendar_add_users_notify = elgg_get_plugin_setting('add_users_notify', 'event_calendar');
+ if ($event_calendar_add_users_notify == 'yes') {
+ $subject = elgg_echo('event_calendar:add_users_notify:subject');
+ $user = get_user($user_guid);
+ $event = get_entity($event_guid);
+ $site_guid = elgg_get_site_entity()->guid;
+ $message = elgg_echo('event_calendar:add_users_notify:body',array($user->name,$event->title,$event->getURL()));
+ notify_user($user_guid, $site_guid, $subject, $message, NULL, 'email');
+ }
$button_text = elgg_echo('event_calendar:remove_from_the_calendar_button');
$response = array('success'=>TRUE, 'message' => $add_response, 'button_text'=>$button_text);
} else {