Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

601
Vistas
Nodemailer and ical-generator - to send calendar invite

I want to send calendar invite. I'm using Nodemailer and ical-generator to generate ical file. Everything working fine but email doesn't add invite to the calendar automatically instead I get an option to Add to calendar. But I want email to directly add event to the calendar.

This is how email looks like -

enter image description here

My code looks like this.

This code converts to ical file and it is being used with Nodemailer icalEvent to send it.

    const content = ical({
    domain: 'google.com',
    method: 'PUBLISH',
    prodId: '//Google Inc//Google Calendar 70.9054//EN',
    timezone: 'Australia/Brisbane',
    scale: 'GREGORIAN',
    events: [
      {
        start: moment(),
        status: 'CONFIRMED',
        end: moment().add(1, 'hour'),
        summary: 'Calendar invite test',
        transparency: 'OPAQUE',
        organizer: {
          name: 'Organiser name',
          email: 'ttt@gmail.com',
          mailto: 'ttt@gmail.com'
        },
        location: 'Zoom',
        attendees: [
          {
            email: 'my-email-address@gmail.com',
            name: 'Shashank Kumar',
            status: 'NEEDS-ACTION',
            rsvp: true,
            type: 'INDIVIDUAL',
            role: 'REQ-PARTICIPANT'
          },
          {
            email: 'mno@gmail.com',
            name: 'Mike Jack',
            status: 'NEEDS-ACTION',
            type: 'INDIVIDUAL',
            role: 'REQ-PARTICIPANT'
          },
          {
            email: 'xyz@gmail.com',
            name: 'Will Paul',
            status: 'NEEDS-ACTION',
            type: 'INDIVIDUAL',
            role: 'REQ-PARTICIPANT'
          }
        ]
      }
    ]
  }).toString();

and then I'm using Nodmailer to send icalEvent

message: {
  to: toEmail,
  headers: {
    'x-invite': {
      prepared: true,
      value: id
    }
  },
  icalEvent: {
    filename: 'invite.ics',
    method: 'PUBLISH',
    content: content
  }
},
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You only need use 'REQUEST' as method instead of 'PUBLISH', this will add automatically to your calendar and show confirmation buttons

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda