hunk.code_window:         let sendTo;
           switch (reminder.workflowStep.action) {
             case WorkflowActions.EMAIL_HOST:
               sendTo = reminder.booking.user?.email;
               break;
             case WorkflowActions.EMAIL_ATTENDEE:
               sendTo = reminder.booking.attendees[0].email;
               break;
  
hunk.labels: keep keep keep keep replace keep keep keep keep
hunk.after_edit:             sendTo = reminder.booking?.userPrimaryEmail ?? reminder.booking.user?.email;
  
hunk.file_path: packages/features/ee/workflows/api/scheduleEmailReminders.ts
hunk.type: replace
file: import type { App_RoutingForms_Form } from "@prisma/client";
  
  import { renderEmail } from "@calcom/emails";
  import BaseEmail from "@calcom/emails/templates/_base-email";
  
  import type { OrderedResponses } from "../../types/types";
  
  type Form = Pick<App_RoutingForms_Form, "id" | "name">;
  export default class ResponseEmail extends BaseEmail {
    orderedResponses: OrderedResponses;
    toAddresses: string[];
    form: Form;
    constructor({
      toAddresses,
      orderedResponses,
      form,
    }: {
      form: Form;
      toAddresses: string[];
      orderedResponses: OrderedResponses;
    }) {
      super();
      this.form = form;
      this.orderedResponses = orderedResponses;
      this.toAddresses = toAddresses;
    }
  
    protected async getNodeMailerPayload(): Promise<Record<string, unknown>> {
      const toAddresses = this.toAddresses;
      const subject = `${this.form.name} has a new response`;
      return {
        from: `Cal.com <${this.getMailerOptions().from}>`,
        to: toAddresses.join(","),
        subject,
        html: await renderEmail("ResponseEmail", {
          form: this.form,
          orderedResponses: this.orderedResponses,
          subject,
        }),
      };
    }
  }
  