phpScheduleIt
May 19, 2013, 07:02:49 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Notification Preferences  (Read 1199 times)
fifthgear
Newbie
*

Karma: 0
Posts: 3


« on: March 25, 2012, 08:43:53 PM »

Hello,

How can I make Notification Preferences to be checked YES by default for every new user ?

I would like to receive e-mail for every booking made by new user without adding participants or adding user to a group, is that possible to do it by default ? 

The reason is that most people won't check to receive notifications by email and I have to check regularly to see if the booking has been made. Getting an email and making sure they receive it as well, would be great.

Regards
Michael
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #1 on: March 27, 2012, 02:06:41 PM »

I'll make a configuration option for this. For now, you can alter lib/Application/Authentication/Registration.php Register() function to also call:


Code:
ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Approved);

ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Created);

ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Updated);

ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Deleted);
Logged
sat_cse28
Newbie
*

Karma: 0
Posts: 16


« Reply #2 on: April 03, 2012, 09:35:43 PM »

Can you tell me in brief where to add on Registration.php file?.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #3 on: April 04, 2012, 02:00:50 PM »

There is a Register() function. You can just put it at the end of that.
Logged
sat_cse28
Newbie
*

Karma: 0
Posts: 16


« Reply #4 on: April 04, 2012, 10:33:52 PM »

Can you tell me after which line i need to add it.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #5 on: April 10, 2012, 09:03:32 AM »

After line 51 will work.
Logged
sat_cse28
Newbie
*

Karma: 0
Posts: 16


« Reply #6 on: April 10, 2012, 09:35:40 PM »

server error it shows page  not loading if i add this after line 51  $this->AutoAssignPermissions($userId);



ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Approved);

ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Created);

ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Updated);

ServiceLocator::GetDatabase()->ExecuteInsert(new AddEmailPreferenceCommand($userId, EventCategory::Reservation, ReservationEvent::Deleted);
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #7 on: April 12, 2012, 02:26:33 PM »

Is anything logged?
Logged
intelek
Newbie
*

Karma: 0
Posts: 18


« Reply #8 on: April 25, 2012, 05:41:06 AM »

Hello, I'm trying to do the same, but i only get this message:

Parse error: syntax error, unexpected ';' in D:\xampp\htdocs\reservas\lib\Application\Authentication\Registration.php on line 52

Best regards.
Logged
intelek
Newbie
*

Karma: 0
Posts: 18


« Reply #9 on: April 25, 2012, 06:26:26 AM »

Hello again, i have find the bug, only put this in the first line:
Code:
require_once(ROOT_DIR . 'lib/Application/Reservation/ReservationEvents.php');
It works fine, thank you, i hope you use it.
Logged
sat_cse28
Newbie
*

Karma: 0
Posts: 16


« Reply #10 on: April 26, 2012, 07:01:16 AM »

do i need to add the 4 lines after $this->AutoAssignPermissions($userId);
    }

??


 PHP Parse error:  syntax error, unexpected T_STRING, expecting T_FUNCTION in /lib/Application/Authentication/Registration.php on line 53
Logged
amf
Newbie
*

Karma: 0
Posts: 6


« Reply #11 on: April 26, 2012, 08:30:40 AM »

ending ) missing on every line
Smiley
Logged
sat_cse28
Newbie
*

Karma: 0
Posts: 16


« Reply #12 on: May 29, 2012, 10:02:49 PM »

Its still shows "Do not notify me"
Logged
salab
Newbie
*

Karma: 0
Posts: 5


« Reply #13 on: June 08, 2012, 02:05:11 PM »

I have same problem as sat_cse28. Please paste here full file. Thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!