Deprecated: Gets information about the event's RSVP form and status.
Deprecation note: The getRsvpData
function of the RsvpForm
object is being
deprecated. Use the formData
property of
the Form
object instead.
The getRsvpData()
function returns a Promise that resolves to an
RsvpData
object containing all the information you need to create
a custom RSVP form for the specified event.
This information includes:
Note: To work with the Wix Events API, you need to publish your site.
function getRsvpData(): Promise<RsvpData>;
import wixEventsFrontend from 'wix-events-frontend';
// ...
const eventId = // Get the event ID
const form = wixEventsFrontend.createEventRsvpForm(eventId)
form.getRsvpData()
.then((rsvpData) => {
let fields = rsvpData.rsvpFormInputs;
let firstFieldName = fields[0].name;
let statusOptions = rsvpData.rsvpStatusOptions;
let registrationStatus = rsvpData.registrationStatus;
});
/* rsvpData:
*
* {
* "rsvpStatusOptions": "YES_AND_NO,
* "registrationStatus": "OPEN_RSVP",
* "rsvpFormInputs": [
* {
* "_id": "37a5789b-27d1-43a3-703b-a93dedad5b01",
* "additionalLabels": [],
* "array": false,
* "controlType": "NAME",
* "label": "First Name",
* "required": true,
* "maxLength": 50,
* "name": "firstName",
* "options": []
* },
*
* ...
*
* {
* "_id": "27d5789b-137a-43ed-a33d-a9703bad5b01",
* "additionalLabels": [
* {
* "name": "one",
* "label": "I'm bringing a plus one"
* },
* {
* "name": "multiple",
* "label": "Additional Guests"
* }
* ],
* "array": false,
* "controlType": "GUEST_CONTROL",
* "label": "I'm bringing a plus one",
* "required": true,
* "maxLength": 0,
* "name": "additionalGuests",
* "options": [
* "0",
* "1"
* ]
* }
* ]
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.