Posted: February 8, 2018 at 5:01 pm
I attempting to add rows to an https://airtable.com/ base using AHEE__EE_Registration_Processor__trigger_registration_update_notifications
I have the Airtable side working, now I need to pull the info from the current registration.
// to get the transaction object
// add your code here
$args = array();
$args["Event"] = $transaction->"Event";
airtable_create( $base, $form, $args );
This code isn’t working. How do I access all the fields above in the $transaction object?
Thanks for your help.
To do what you are trying to do you need a working knowledge of PHP and OOP, there’s a lot of problems with the code you’ve posted.
It looks like you are trying to access values within the transaction object in a similar way to accessing keys in an array which won’t work and also the transaction object doesn’t store a lot of the details your trying to output.
In the above your attempting to pull ‘Event’, ‘Registration’, ‘Attendee’, ‘Contact’ and ‘Question/Answer’ values all from the transaction object, most of those aren’t available like that.
You can use our model system to pull the information from the transaction:
Can I ask why that specific hook?
Thanks for your help with this. I know PHP pretty well but not OOP. I took a look at the link you sent and it looks like get_one_by_ID() will do the trick.
So now the question is, how do I get the current registration ID from
I’m new to EE, so is there a better hook I should use?
I want to add the row to the Airtable base after the registration has been processed. It would be helpful to know if the payment was successful or not.
Actually, I only want to add the row if the payment was received.
For which? You can pull some of the details from the transaction object, for example:
Gives you an array of registration objects, then loop over the array and do whatever you wish with each registration object.
Try using kint debugger, wrap the transaction object in
Then do the same with the registration object when you have it and so on.
Where do you want to output the table?
Okay, I’ll give the kint debugger a try.
I want to send the table to Airtable. I need to get all the fields mentioned in the first post and send to Airtable via their API. This part is working. I just need to get data from all the fields from Event Espresso.
Is there a better hook I should use?
May I ask what are the determining factors that would potentially make one hook be better than another?