0 votes
var invite = mail.Appointments[0];
Appointment appointment;               
appointment = invite.Decline(mail.From.ToString());

above code not work for me.

"Creates new appointment with Limilabs.Mail.Appointments.Participant.Status set
to Limilabs.Mail.Appointments.ParticipationStatus.Declined for users with specified"

I do not understand the description in decline method. can you please elaborate?

by (1.6k points)

1 Answer

+1 vote

If the appointment is organized by Alice (organizer) and send to Bob (attendee) you should decline as Bob (attendee):

var decline = invite.Decline("bob@example.com");

This creates an iCalendar entity with Bob's participation status set to Declined:

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
METHOD:REPLY
BEGIN:VEVENT
DTSTART;VALUE=DATE:20191230
DTEND;VALUE=DATE:20191231
DTSTAMP:20100508T173704Z
ORGANIZER;CN=Alice:mailto:alice@example.com
UID:e595e21e-2d0c-4966-b127-4fd40233d7eb
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=DECLINED;CN=
Bob:mailto:bob@example.com
STATUS:CONFIRMED
END:VEVENT
END:VCALENDAR

by (300k points)
It gives me tentatively accept even in decline method.

BEGIN:VCALENDAR
VERSION:2.0
METHOD:REPLY
PRODID:-//Limilabs//Mail.dll//EN
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYDAY=1SU
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:040000008200E00074C5B7101A82E0080000000030271F03370AD501000000000000000
010000000DD02C8B3BC3A7E4184AC98EF3CC9F7A1
CLASS:PUBLIC
STATUS:CONFIRMED
DTSTAMP:20190514T132546Z
DTSTART:20190516T093000
DTEND:20190516T100000
ORGANIZER;CN=Ilesh Parmar:MAILTO:IleshP@churchillliving.com
PRIORITY:5
SEQUENCE:0
SUMMARY:Test Meeting Declined
DESCRIPTION:\n
LOCATION:USS
ATTENDEE;CN=Test API;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:M
AILTO:TestAPI@churchillcorp.com
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR
You must be using incorrect email address when calling invite.Decline("participant email goes here");
email address is correct but I think PARTSTAT=NEEDS-ACTION; course the issue.
What email address you are using?

Could you please zip the original invitation and send to the email address shown in this page footer.
Email was just sent.
From your email I gather you are using "testapi@churchillcorp.com" as attendee email.

This is not correct. Attendee email is TestAPI@churchillcorp.com.

Comparison is case sensitive on local part (TestAPI) and insensitive on domain part (churchillcorp.com).
Thank you so much it has resolved the issue. but I think email id should not case sensitive.
Local part might be case sensitive, domain part must be case insensitive.

If you need a different behavior: you can iterate over attendees and preform email search in case insensitive manner first.
...