Class ICalAttendee

Usually you get an ICalAttendee object like this:

import ical from 'ical-generator';
const calendar = ical();
const event = calendar.createEvent();
const attendee = event.createAttendee({ email: 'mail@example.com' });

You can also use the ICalAttendee object directly:

import ical, {ICalAttendee} from 'ical-generator';
const attendee = new ICalAttendee({ email: 'mail@example.com' });
event.attendees([attendee]);

Constructors

Methods

  • Get the attendee's delegated-to value.

    Returns null | ICalAttendee

    Since

    0.2.0

  • Set the attendee's delegated-to field.

    Creates a new Attendee if the passed object is not already a ICalAttendee object. Will set the delegatedTo and delegatedFrom attributes.

    Will also set the status to DELEGATED, if attribute is set.

    const cal = ical();
    const event = cal.createEvent();
    const attendee = cal.createAttendee();

    attendee.delegatesTo({email: 'foo@bar.com', name: 'Foo'});

    Parameters

    Returns this

    Since

    0.2.0

  • Create a new attendee this attendee delegates from and returns this new attendee. Creates a new attendee if the passed object is not already an ICalAttendee.

    const cal = ical();
    const event = cal.createEvent();
    const attendee = cal.createAttendee();

    attendee.delegatesFrom({email: 'foo@bar.com', name: 'Foo'});

    Parameters

    Returns ICalAttendee

    Since

    0.2.0

  • Create a new attendee this attendee delegates to and returns this new attendee. Creates a new attendee if the passed object is not already an ICalAttendee.

    const cal = ical();
    const event = cal.createEvent();
    const attendee = cal.createAttendee();

    attendee.delegatesTo({email: 'foo@bar.com', name: 'Foo'});

    Parameters

    Returns ICalAttendee

    Since

    0.2.0

  • Get the attendee's email address

    Returns string

    Since

    0.2.0

  • Set the attendee's email address

    Parameters

    • email: string

    Returns this

    Since

    0.2.0

  • Get the attendee's email address

    Returns null | string

    Since

    1.3.0

  • Set the attendee's email address

    Parameters

    • mailto: null | string

    Returns this

    Since

    1.3.0

  • Get the attendee's name

    Returns null | string

    Since

    0.2.0

  • Set the attendee's name

    Parameters

    • name: null | string

    Returns this

    Since

    0.2.0

  • Get attendee's RSVP expectation

    Returns null | boolean

    Since

    0.2.1

  • Set the attendee's RSVP expectation

    Parameters

    • rsvp: null | boolean

    Returns this

    Since

    0.2.1

  • Get the acting user's email adress

    Returns null | string

    Since

    3.3.0

  • Set the acting user's email adress

    Parameters

    • email: null | string

    Returns this

    Since

    3.3.0

  • Return generated attendee as a string.

    console.log(attendee.toString()); // → ATTENDEE;ROLE=…
    

    Returns string

  • Set X-* attributes. Woun't filter double attributes, which are also added by another method (e.g. status), so these attributes may be inserted twice.

    attendee.x([
    {
    key: "X-MY-CUSTOM-ATTR",
    value: "1337!"
    }
    ]);

    attendee.x([
    ["X-MY-CUSTOM-ATTR", "1337!"]
    ]);

    attendee.x({
    "X-MY-CUSTOM-ATTR": "1337!"
    });

    Parameters

    • keyOrArray: Record<string, string> | [string, string][] | {
          key: string;
          value: string;
      }[]

    Returns this

    Since

    1.9.0

  • Set a X-* attribute. Woun't filter double attributes, which are also added by another method (e.g. status), so these attributes may be inserted twice.

    attendee.x("X-MY-CUSTOM-ATTR", "1337!");
    

    Parameters

    • keyOrArray: string
    • value: string

    Returns this

    Since

    1.9.0

  • Get all custom X-* attributes.

    Returns {
        key: string;
        value: string;
    }[]

    Since

    1.9.0

Generated using TypeDoc