ync customer details into Google Calendar

48 views
Skip to first unread message

decke wand boden Wohnfachmarkt

unread,
May 27, 2024, 11:22:34 AMMay 27
to Easy!Appointments - Support Group
Hello dear community, I have a problem and hope you can help me.

When an appointment is booked, the provider/customer/EMAIL/phone information can be seen in the easy calendar.


However, this information is not included when syncing with Google.


I have already found the Google_sync.php file.

Here the function is created in lines 153 to 192.
Unfortunately, I'm not a programmer and don't understand what information I have to enter here so that the data is transferred to the notes section of my Google Calendar.

I hope you can help me.
This is the code area that I was able to identify:


public function add_appointment(
        array $appointment,
        array $provider,
        array $service,
        array $customer,
        array $settings,
    ): Event {
        $event = new Google_Service_Calendar_Event();
        $event->setSummary(!empty($service) ? $service['name'] : 'Unavailable');
        $event->setDescription($appointment['notes']);
        $event->setLocation($appointment['location'] ?? $settings['company_name']);

        $timezone = new DateTimeZone($provider['timezone']);

        $start = new Google_Service_Calendar_EventDateTime();
        $start->setDateTime(
            (new DateTime($appointment['start_datetime'], $timezone))->format(DateTimeInterface::RFC3339),
        );
        $event->setStart($start);

        $end = new Google_Service_Calendar_EventDateTime();
        $end->setDateTime((new DateTime($appointment['end_datetime'], $timezone))->format(DateTimeInterface::RFC3339));
        $event->setEnd($end);

        $event->attendees = [];

        $event_provider = new Google_Service_Calendar_EventAttendee();
        $event_provider->setDisplayName($provider['first_name'] . ' ' . $provider['last_name']);
        $event_provider->setEmail($provider['email']);
        $event->attendees[] = $event_provider;

        if (!empty($customer['first_name']) && !empty($customer['last_name']) && !empty($customer['email'])) {
            $event_customer = new Google_Service_Calendar_EventAttendee();
            $event_customer->setDisplayName($customer['first_name'] . ' ' . $customer['last_name']);
            $event_customer->setEmail($customer['email']);
            $event->attendees[] = $event_customer;
        }

        // Add the new event to the Google Calendar.
        return $this->service->events->insert($provider['settings']['google_calendar'], $event);
    }

decke wand boden Wohnfachmarkt

unread,
May 28, 2024, 5:04:30 AMMay 28
to Easy!Appointments - Support Group
Ich habe die Lösung gefunden und möchte diese hier mit euch allen Teilen :     

// Erstellung der Beschreibung mit dem Titel der E-Mail, den Notizen und dem Kundenname
    $description = !empty($service) ? $service['name'] : 'Unavailable';
    $description .= "\n\n"; // Leerzeile
$description .= "Termin: " . date('d. m. Y | H:i', strtotime($appointment['start_datetime'])) . " Uhr\n\n";
    $description .= $appointment['notes'] ?? '';
    if (!empty($customer['first_name']) && !empty($customer['last_name'])) {
        $description .= "\n\n"; // Leerzeile
        $description .= "Interessent: " . $customer['first_name'] . " " . $customer['last_name'] . "\n";
        $description .= "\n"; // Leerzeile
        $description .= "Telefonnummer: " . $customer['phone_number'] . "\n";
        $description .= "\n"; // Leerzeile
        $description .= "Email Adresse: " . $customer['email'] . "\n";
$description .= "\n"; // Leerzeile
    }
    $event->setDescription($description);
Übersetzungsergebnisse verfügbar 

decke wand boden Wohnfachmarkt

unread,
May 28, 2024, 5:19:04 AMMay 28
to Easy!Appointments - Support Group
I found the solution and would like to share it with you all here:

    // Erstellung der Beschreibung mit dem Titel der E-Mail, den Notizen und dem Kundenname
    $description = !empty($service) ? $service['name'] : 'Unavailable';
    $description .= "\n\n"; // Leerzeile
$description .= "Termin: " . date('d. m. Y | H:i', strtotime($appointment['start_datetime'])) . " Uhr\n\n";
    $description .= $appointment['notes'] ?? '';
    if (!empty($customer['first_name']) && !empty($customer['last_name'])) {
        $description .= "\n\n"; // Leerzeile
        $description .= "Interessent: " . $customer['first_name'] . " " . $customer['last_name'] . "\n";
        $description .= "\n"; // Leerzeile
        $description .= "Telefonnummer: " . $customer['phone_number'] . "\n";
        $description .= "\n"; // Leerzeile
        $description .= "Email Adresse: " . $customer['email'] . "\n";
$description .= "\n"; // Leerzeile
    }
    $event->setDescription($description);

Alex Tselegidis

unread,
Jun 4, 2024, 7:55:05 AMJun 4
to Easy!Appointments - Support Group
Hello! 

For other thread visitors, this is also linked to this: 




Alex Tselegidis, Easy!Appointments Creator
Need a customization? Get a free quote!



Reply all
Reply to author
Forward
0 new messages
Search
Clear search
Close search
Google apps
Main menu