Posted: June 26, 2023 at 7:17 am
I have an event cron activated by an event having the QR codes scanned by attendees to check in. This data is then sent on for an email. We just realised that attendees who are checked in manually on the app do not populate the database for the event cron, and my IT is wondering where this can be accessed so it can also be used for the email. |
|
Hi there, What are they currently using to ‘trigger’ the cron currently? A hook within EE? |
|
Ahh, as far as I know it is the scanning of a QR code that triggers the cron. Since we have events without using tickets and they dont need the cron email. Specifically I dont know more than that. I will ask. |
|
I’ll explain my thinking here as it’ll make sense as to why I’m asking. A cron is just a schedule, it’s a way to say “every X amount of time do Y function”. Your task is “This data is then sent on for an email.” which doesn’t really make sense to use a cron for if you are doing that on EVERY scan. If its an email that bulk sends details for all checked-in/out registrations every X hours/days etc then that does make sense to use a cron however, it then doesn’t make sense as to why only check-ins through the app are working. Manual check-ins change the same data so I’m not sure how they are pulling the data in but manual check-ins and scanning the barcode to check-in change the same check-in record so it could be a case of using the wrong hook or searching for the wrong data, I don’t know without details of the code they are using. |
|
Completely logical, the reason we set it up was to create attendance certificates which isn’t part of EE. So we use the Ticket Add-on, and us the check-in feature to trigger the cron. The custom code then runs the populated custom table to send an email / attendance certificate 5 days after event closure. No hook is used, but it seems the QR code was the main trigger. I discovered this anomaly as i set up a test event and only manually checked (myself) in (also using this to test the other URL issue i was having with the App). The use of the manual check in did not trigger the cron. I‘m making the assumption that if I had scanned a QR code it would have. There is a big time zone difference between you and my IT, so I am also wondering if I need to set up a new test event, and check in attendees using both methods and see what happens. In the meantime I am waiting on a response to see if I can send you the code that triggers the cron. |
|
My guess is if you set up a new event and have a manually checked in and barcode scanned registrant you’ll get both. I’m assuming the scan is setting up the cron for the event itself… but just guessing based on how I think it would work. Doesn’t hurt to try it so I’d set that up to test in the meantime personally 🙂 |
|
This reply has been marked as private. | |
Hi there, Unless I’m missing something, that’s not using a cron. It’s using the request sent from the app itself which checks in the user to trigger an email on that same request, not on a cron. So the reason it’s not working for ‘manual’ check-ins is because the manual check-ins do not contain the same data in the request (it’s not needed for those), so this:
Is not set on those manual check-in requests. There are a couple of notes on that code, the developer isn’t using our model system in that code, which isn’t the end of the world, but the models take a lot of the work out of the above for you once you get to know how to use them. I don’t know what hook (if any) that code is running on, but there’s a dynamic hook within Event Espresso that fires when a registration is checked-in/out:
(Search the EE codebase to find it) If they wanted to trigger an email only when a registration is checked in, just hook into Looks like they are using a custom table to track if a registration has been checked in, we already have that within core. The EE_Registration object (which is passed in the above hook) has multiple methods for checkins, for example I highly recommend they take a look at the model docs: https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System A lot of what they are doing within that code can be handled by the models easier and without custom tables (although I have no idea if that table is used elsewhere but again even that could likely be handled using our models to get what is needed there), the hook I mentioned removes the ‘working on X but not on Y requests’. |
|
Thanks for your quick & thorough reply – I’ve forwarded this onto them. I have no idea 🙂 |
|
You’re most welcome 🙂 |
|
Original thread: https://eventespresso.com/topic/accessing-checked-in-data-from-event-qr-code-and-manually-checking-from-the-app/#post-345158 My IT has been unable to find the correct hook where manually arrived attendees are checked in. The hook for QR attendees is fine, but for whatever reason this appears not to include manually checked in. We need a single hook for both. The previous thread had lots of info from Tony, but apparently was not sufficient to resolve the question. TIA |
|
Hi there, The info I gave you in the previous post is pretty much exactly what you are asking for here:
Is a hook that will fire whenever a registration is checked in be that automatically, through the app, manually or any other way. When the checked-in status is switched to checked_in, that hook ‘fires’. Is there something specific they are struggling with when using that hook? |
|
I figured that was the case, but for whatever reason they seem unable to make it work. I wanted to keep the other thread going but it was closed off. Thank you and I shall pass this on and see how it goes… |
|
If they can provide more details I may be able to help. What issue are they running into when using that hook?
Threads automatically close when there are no replies within 14 days. I’ll re-open it and merge this one into it. |
|
This reply has been marked as private. | |
So still not using our models to make this easier for some reason and duplicating queries due to not using the models. Excluding the check for an existing check-in record, an email can be triggered using that hook simply using:
The current EE_Registration object is passed to the filter, so it doesn’t need to pulled from the database again using the registration ID.
Theres a bunch of ‘getters’ on both of those objects to get all the info they would need, like I’ve tested the above and it triggers and email when manually checking in and through the app. Checking for a previous check-in record I’ll leave to the developer as otherwise I’m basically writing the custom function for them, if they learn how to use the model system it’s relatively straightforward. |
|
Ok. Thanks for that. I passed it on. Not knowing code doesn’t help Me, them not following your advice even less. Tia |
|
My sympathies, I know your the middle man here and that must be frustrating for you 🙂 But, even without knowing the code in use it’s likely you can see yourself how using the models makes this much easier. 7 lines of code above to pull in the registration, then the attendee, replaced with simply:
which is using the registration object passed to the filter to pull in the related attendee…. DONE. Then just using The difference is they need to lead a little about our model system to use it but that quickly pays off the more they work with EE. Anyway, I’m rambling 🙂 any further questions just let me know. |
|
So they redid the code with the following, and tell me that it still does not pull in manually check-in people.
|
|
I know you’re stuck in the middle here, but that’s an exact copy of my code with no other change than to add their email address in the to field of That code works for me: https://monosnap.com/file/5xhNSEp4TVcbvO9PFP916KmtkoA7aG That video has the code set on the site, showing the WP Mail log with no emails, me manually checking in a registrant and refreshing the mail log to confirm an email triggered. |
|
It may seem hard to believe, but it worked! Thank you for your patience and assistance as always. In the process of testing the manual checkin something odd did happen though. A login on my mobile worked fine, on the IT’s mobile device not. Tried several things but was never able to get them to be able to log in. Any logical reason why that might have occurred ? |
|
Haha, nope, using the correct hook is a great leap forward. Using the models then just make things easier 🙂
You’re most welcome.
There’s lof of reasons this can happen. You mentioned mobile so I assume you mean through he EE4 Mobile apps and not logging into the site itself? |
|
The support post ‘Accessing checked-in data from event QR code AND manually checking from the App’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.