How do I get a list of events that a user has rsvp'd to?

Home Forums Ticket Products Event Tickets Plus How do I get a list of events that a user has rsvp'd to?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1506461
    Jon
    Participant

    The platform I’m building only allows registered users to RSVP to an event (using the Event Tickets plugin). I’d like to be able to retrieve programmatically a list of events that a WordPress user has RSVP’d to. I can’t seem to find this in the docs (tribe_tickets_get_event_ids doesn’t seem to take in a user id (the closest thing I can find is an attendee_id but I’m not sure how to link a wordpress user id to attendee_id)). Please could you tell me what the easiest way would be to find the events a user has rsvp’d to?

    #1507952
    Andras
    Keymaster

    Hi hgillespiegallery,

    Thanks for getting in touch!

    That is a great question there.

    At the moment there is no direct function to access all the tickets / RSVPs of a user, but you could do that with a custom SQL query. Every sold ticket has the purchaser’s user ID attached to it.

    The following query will give you the IDs of all the events the user has RSVP’d to:

    SELECT post_id FROM wp_postmeta WHERE (meta_key = '_tribe_tickets_attendee_user_id' AND meta_value = '1')

    That includes both positive and negative responses.

    Hope this helps. Let me know if you have further questions.

    Cheers,
    Andras

    #1525353
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How do I get a list of events that a user has rsvp'd to?’ is closed to new replies.