calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
31.21k stars 7.53k forks source link

(bug) Cancelation email is using event type slug instead of event type title. #16290

Closed Lucas-dOliveira closed 2 weeks ago

Lucas-dOliveira commented 3 weeks ago

Issue Summary

The cancellation email is using the Event Type slug instead of Event Type title

Steps to Reproduce

  1. Create an appointment:
    curl --request POST \
    --url https://api.cal.com/v2/bookings \
    --header 'Content-Type: application/json' \
    --header 'x-cal-client-id: <CLIENT_ID>' \
    --data '{
    "start": "2024-08-21T12:30:00.000Z",
    "end": "2024-08-21T13:00:00.000Z",
    "eventTypeId": 988391,
    "eventTypeSlug": "f367552d-6747-4abb-8461-5abd222b669b",
    "timeZone": "America/Sao_Paulo",
    "language": "en",
    "responses": {
    "name": "Lucas de Oliveira",
    "email": "lucas@tivita.com"
    },
    "user": "no-reply-02c77750-84a5-4408-a20d-0be1bedf5dd1-clxep4zi50004qc1n9mxy72kf-tivita",
    "metadata": {},
    "hasHashedBookingLink": false
    }

Appointment creation email properly using the event type title Atendimento online: image

  1. Cancel the appointment
    curl --request POST \
    --url https://api.cal.com/v2/bookings/2977884/cancel 

    Email received image

Expected behavior

The cancellation email should use the same format as the scheduled email

Other information

Event type information (From managed event type):

{
    "status": "success",
    "data": {
        "eventType": {
            "id": 988391,
            "title": "Atendimento online",
            "slug": "f367552d-6747-4abb-8461-5abd222b669b",
            "description": "Atendimento remoto",
            "length": 30,
            "isInstantEvent": false,
            "instantMeetingExpiryTimeOffsetInSeconds": 90,
            "aiPhoneCallConfig": null,
            "offsetStart": 0,
            "hidden": false,
            "eventName": null,
            "customInputs": [],
            "timeZone": null,
            "periodType": "UNLIMITED",
            "periodDays": null,
            "periodStartDate": null,
            "periodEndDate": null,
            "periodCountCalendarDays": null,
            "lockTimeZoneToggleOnBookingPage": false,
            "requiresConfirmation": false,
            "requiresBookerEmailVerification": false,
            "recurringEvent": null,
            "hideCalendarNotes": false,
            "disableGuests": true,
            "minimumBookingNotice": 0,
            "beforeEventBuffer": 0,
            "afterEventBuffer": 0,
            "slotInterval": 0,
            "hashedLink": null,
            "bookingLimits": null,
            "onlyShowFirstAvailableSlot": false,
            "durationLimits": null,
            "assignAllTeamMembers": true,
            "successRedirectUrl": null,
            "forwardParamsSuccessRedirect": true,
            "currency": "usd",
            "bookingFields": [
                {
                    "name": "name",
                    "type": "name",
                    "defaultLabel": "your_name",
                    "required": true,
                    "editable": "system",
                    "sources": [
                        {
                            "id": "default",
                            "type": "default",
                            "label": "Default"
                        }
                    ]
                },
                {
                    "name": "email",
                    "type": "email",
                    "defaultLabel": "email_address",
                    "required": true,
                    "editable": "system",
                    "sources": [
                        {
                            "id": "default",
                            "type": "default",
                            "label": "Default"
                        }
                    ]
                },
                {
                    "name": "location",
                    "type": "radioInput",
                    "defaultLabel": "location",
                    "required": false,
                    "getOptionsAt": "locations",
                    "optionsInputs": {
                        "attendeeInPerson": {
                            "type": "address",
                            "required": true,
                            "placeholder": ""
                        },
                        "phone": {
                            "type": "phone",
                            "required": true,
                            "placeholder": ""
                        }
                    },
                    "hideWhenJustOneOption": true,
                    "editable": "system",
                    "sources": [
                        {
                            "id": "default",
                            "type": "default",
                            "label": "Default"
                        }
                    ]
                },
                {
                    "name": "title",
                    "type": "text",
                    "defaultLabel": "what_is_this_meeting_about",
                    "defaultPlaceholder": "",
                    "required": true,
                    "hidden": true,
                    "editable": "system-but-optional",
                    "sources": [
                        {
                            "id": "default",
                            "type": "default",
                            "label": "Default"
                        }
                    ]
                },
                {
                    "name": "notes",
                    "type": "textarea",
                    "defaultLabel": "additional_notes",
                    "defaultPlaceholder": "share_additional_notes",
                    "required": false,
                    "editable": "system-but-optional",
                    "sources": [
                        {
                            "id": "default",
                            "type": "default",
                            "label": "Default"
                        }
                    ]
                },
                {
                    "name": "guests",
                    "type": "multiemail",
                    "defaultLabel": "additional_guests",
                    "defaultPlaceholder": "email",
                    "required": false,
                    "hidden": true,
                    "editable": "system-but-optional",
                    "sources": [
                        {
                            "id": "default",
                            "type": "default",
                            "label": "Default"
                        }
                    ]
                },
                {
                    "name": "rescheduleReason",
                    "type": "textarea",
                    "defaultLabel": "reason_for_reschedule",
                    "defaultPlaceholder": "reschedule_placeholder",
                    "required": false,
                    "views": [
                        {
                            "label": "Reschedule View",
                            "id": "reschedule"
                        }
                    ],
                    "editable": "system-but-optional",
                    "sources": [
                        {
                            "id": "default",
                            "type": "default",
                            "label": "Default"
                        }
                    ]
                }
            ],
            "useEventTypeDestinationCalendarEmail": false,
            "owner": {
                "id": 948282
            },
            "parent": {
                "id": 988389,
                "teamId": 17460
            },
            "teamId": null,
            "team": null,
            "users": [
                {
                    "name": "Unidade principal tivita",
                    "avatarUrl": null,
                    "username": "no-reply-02c77750-84a5-4408-a20d-0be1bedf5dd1-clxep4zi50004qc1n9mxy72kf-tivita",
                    "id": 948282,
                    "email": "no-reply+02c77750-84a5-4408-a20d-0be1bedf5dd1+clxep4zi50004qc1n9mxy72kf@tivita.com",
                    "locale": null,
                    "defaultScheduleId": 298239,
                    "nonProfileUsername": "no-reply-02c77750-84a5-4408-a20d-0be1bedf5dd1-clxep4zi50004qc1n9mxy72kf-tivita",
                    "profile": {
                        "username": "no-reply-02c77750-84a5-4408-a20d-0be1bedf5dd1-clxep4zi50004qc1n9mxy72kf-tivita",
                        "id": 9595,
                        "userId": 948282,
                        "uid": "d8236626-938e-4452-932f-82ec25072fbc",
                        "name": "Tivita",
                        "organizationId": 15637,
                        "organization": {
                            "id": 15637,
                            "slug": null,
                            "name": "Tivita",
                            "logoUrl": "/api/avatar/6e0f8822-99fa-402a-a739-38aeca3dc173.png",
                            "calVideoLogo": null,
                            "bannerUrl": null,
                            "requestedSlug": "tivita",
                            "metadata": {
                                "requestedSlug": "tivita",
                                "orgSeats": null,
                                "orgPricePerSeat": null
                            }
                        },
                        "upId": "9595"
                    },
                    "avatar": "https://app.cal.com/avatar.svg"
                }
            ],
            "schedulingType": null,
            "schedule": 298239,
            "hosts": [],
            "userId": 948282,
            "price": 0,
            "children": [],
            "destinationCalendar": null,
            "seatsPerTimeSlot": null,
            "seatsShowAttendees": false,
            "seatsShowAvailabilityCount": true,
            "webhooks": [],
            "workflows": [],
            "secondaryEmailId": null,
            "scheduleName": null,
            "locations": [
                {
                    "type": "integrations:daily"
                }
            ],
            "metadata": {
                "managedEventConfig": {},
                "apps": {
                    "giphy": {
                        "enabled": false,
                        "thankYouPage": ""
                    }
                }
            },
            "bookerUrl": "https://tivita.cal.com"
        },
        "locationOptions": [
            {
                "label": "Conferencing",
                "options": [
                    {
                        "value": "integrations:daily",
                        "label": "Cal Video (Global)",
                        "disabled": false,
                        "icon": "/app-store/dailyvideo/icon.svg",
                        "slug": "daily-video",
                        "credentialId": 0,
                        "teamName": "Global"
                    },
                    {
                        "label": "Organizer's default app",
                        "value": "conferencing",
                        "icon": "/link.svg"
                    }
                ]
            },
            {
                "label": "in person",
                "options": [
                    {
                        "label": "In Person (Attendee Address)",
                        "value": "attendeeInPerson",
                        "icon": "/map-pin-dark.svg"
                    },
                    {
                        "label": "In Person (Organizer Address)",
                        "value": "inPerson",
                        "icon": "/map-pin-dark.svg"
                    }
                ]
            },
            {
                "label": "Other",
                "options": [
                    {
                        "label": "Link meeting",
                        "value": "link",
                        "icon": "/link.svg"
                    }
                ]
            },
            {
                "label": "phone",
                "options": [
                    {
                        "label": "Attendee Phone Number",
                        "value": "phone",
                        "icon": "/phone.svg"
                    },
                    {
                        "label": "Organizer Phone Number",
                        "value": "userPhone",
                        "icon": "/phone.svg"
                    }
                ]
            }
        ],
        "destinationCalendar": null,
        "team": null,
        "teamMembers": [],
        "currentUserMembership": null,
        "isUserOrganizationAdmin": false
    }
}

Screenshots

image

Environment

Desktop (please complete the following information)

do not apply
niks-nikhil-anand commented 3 weeks ago

started working on this issues...#Nikhil Anand

Sanjoy-droid commented 2 weeks ago

@Lucas-dOliveira I am unable to reproduce the bug it is working fine, at time of canceling the meeting it is not giving me slug value instead of giving me exactly same value which I set when scheduling the meeting. I think the bug is fixed already , you can try once again reproducing the issue!!!

Lucas-dOliveira commented 2 weeks ago

Hey @Sanjoy-droid

Just tested and it's still happening:

image sorry for the pt-br example.

I'm trying to figure out if this is happening due to the managed event type that is being used, I'm not using atoms, I'm calling directly the v2 API.

How to simulate:

CarinaWolli commented 2 weeks ago

@Lucas-dOliveira are you sure this is still happening? There was a fix for that going live last week: https://github.com/calcom/cal.com/pull/16240

Lucas-dOliveira commented 2 weeks ago

@CarinaWolli I tested today and it's fixed đŸ¥³. I'll close this issue, thank you.