phpScheduleIt
June 19, 2013, 04:18:14 AM *
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: "Confirm Resource Use" Button  (Read 741 times)
psi_newbie
Newbie
*

Karma: 0
Posts: 39


« on: February 11, 2012, 09:13:16 AM »

Hey Nick or any ScheduleIt expert,

I am currently modifying the application to suit my needs and i want a function that allows a thank you email to be sent to the reservation owner after a resource has been used. After the resource time expires, the admin clicks the reservation and clicks the "Confirm Resource Use" button and the email is sent to the client.

Please how can i achieve this? Experts, Nick, please help
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #1 on: February 13, 2012, 01:26:12 PM »

If you want to do this manually (have someone click a link) I'd suggest creating a new page for this. You can find all reservations that have ended recently and then click a button that posts back with the reservation ID. This could load up the reservation details and shoot off the email. You'd need to record the fact that you sent the email and not return those reservations on the page. You could extend or create a database table to store that information. You'd need to save it after the email is sent and read it when you load the reservations that haven't been confirmed.

You can also do this automatically, similar to how the reminders work. You'd just pull all recently ended reservations, send the email, and record the fact that you sent the email for that reservation.
Logged
psi_newbie
Newbie
*

Karma: 0
Posts: 39


« Reply #2 on: February 13, 2012, 04:59:47 PM »

Hi Nick, thanks for your reply. It is better to use a button just in case the client didn't use the reservation anymore.

But I am a php beginner and I was able to create the button already but could you please elaborate on what you posted. If possible, please give me a specific example, as per, code wise. And is it also possible to have a form sent in the email?

Thank you again
Logged
psi_newbie
Newbie
*

Karma: 0
Posts: 39


« Reply #3 on: February 14, 2012, 11:28:05 AM »

I have created the button in the reserve.template.php file but how do i get the button to send an email to the user? I am guessing it has something to do with creating a function in reservation.class.php (just following the delete checkbox and del_res()). Please am i on the right track or is there something else i need to do?

Please i need your help.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #4 on: February 14, 2012, 01:18:16 PM »

If this were a simple change I'd be happy to help. This is definitely non-trivial and my best advice is to check out how the reminders functionality works and mimic that.
Logged
psi_newbie
Newbie
*

Karma: 0
Posts: 39


« Reply #5 on: February 15, 2012, 02:14:43 AM »

But if i mimic the reminder function, how do i make sure it doesn't send the email automatically. How do i make sure it sends the mail after a button is clicked?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #6 on: February 15, 2012, 10:23:38 AM »

I guess the part to mimic would be:

1) Get the list of reservations that need to be "thanked"
2) -different- Display the reservations in a list, and provide a way to manually trigger the email to be sent
3) Marking them as "sent" after you send the email
Logged
psi_newbie
Newbie
*

Karma: 0
Posts: 39


« Reply #7 on: February 15, 2012, 02:04:32 PM »

i was kind of hoping there will be a button in the reservation form and when a reservation has been used up, the admin goes back into that reservation and clicks the button, then the email is sent just by clicking the button.

That way, we can handle the Thank you mail individually and not mistakenly send a thank you mail to a client that hasn't even used their reservation. If it were to be a list of reservations waiting for emails to be sent to them, the possibility of a mistake is higher.

And i was also hoping the button idea would be easier.
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5506


WWW
« Reply #8 on: February 16, 2012, 03:16:08 PM »

You can add the button there, it's just going to be a bit more work and will make it harder to update.
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!