phpScheduleIt
May 19, 2013, 04:43:30 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: Reservation ID in Email  (Read 314 times)
alex.herreid
Newbie
*

Karma: 0
Posts: 4


« on: July 22, 2012, 04:48:15 PM »

Hi Nick,
I am wanting to add the reservation ID into the email that is generated for new reservations. Any tips?
thanks
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #1 on: July 23, 2012, 02:57:36 PM »

Technically it's already there in the link. If you want to print it out you'll need to change lib/Email/Messages/ReservationEmailMessage.php starting on line 74 to this:

Code:
protected function PopulateTemplate()
    {
        $currentInstance = $this->reservationSeries->CurrentInstance();
        $this->Set('StartDate', $currentInstance->StartDate()->ToTimezone($this->timezone));
        $this->Set('EndDate', $currentInstance->EndDate()->ToTimezone($this->timezone));
        $this->Set('ResourceName', $this->reservationSeries->Resource()->GetName());
        $this->Set('Title', $this->reservationSeries->Title());
        $this->Set('Description', $this->reservationSeries->Description());

        $repeatDates = array();
        if ($this->reservationSeries->IsRecurring())
        {
            foreach ($this->reservationSeries->Instances() as $repeated)
            {
                $repeatDates[] = $repeated->StartDate()->ToTimezone($this->timezone);
            }
        }
 $this->Set('ReferenceNumber', $currentInstance->ReferenceNumber());
        $this->Set('RepeatDates', $repeatDates);
        $this->Set('RequiresApproval', $this->reservationSeries->RequiresApproval());
        $this->Set('ReservationUrl', sprintf("%s?%s=%s", Pages::RESERVATION, QueryStringKeys::REFERENCE_NUMBER, $currentInstance->ReferenceNumber()));
        $this->Set('ICalUrl', sprintf("export/%s?%s=%s", Pages::CALENDAR_EXPORT, QueryStringKeys::REFERENCE_NUMBER, $currentInstance->ReferenceNumber()));
    }

Then change /lang/en_us/ReservationCreate.tpl to display the ReferenceNumber wherever you want. You'll probably need to clear your template cache, either through the Server Settings while logged in as admin, or by deleting the files in /tpl_c
Logged
vleitch
Newbie
*

Karma: 0
Posts: 38


« Reply #2 on: July 24, 2012, 10:04:30 AM »

Is it also possible to add participants and invitees to the email?
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5403


WWW
« Reply #3 on: July 25, 2012, 11:02:01 AM »

As part of the email body, you mean?
Logged
vleitch
Newbie
*

Karma: 0
Posts: 38


« Reply #4 on: July 26, 2012, 09:36:12 AM »

Yes, as part of the body (not as email recipients).
Logged
alex.herreid
Newbie
*

Karma: 0
Posts: 4


« Reply #5 on: July 28, 2012, 01:27:39 AM »

awesome, that works for me. Thanks for your help!
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!