From 2a3e34d1c5724b29a4f2404081f30b425fcdee50 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Wed, 25 Jan 2012 12:10:45 +0100 Subject: more for add_users and add_users_notify features --- actions/event_calendar/manage_subscribers.php | 2 +- actions/event_calendar/toggle_personal_calendar.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'actions/event_calendar') 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 { -- cgit v1.2.3