Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

607
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda