Support

Home Forums Event Espresso Premium Infusionsoft Event Date Code not working.

Infusionsoft Event Date Code not working.

Posted: January 13, 2016 at 5:01 pm

Viewing 11 reply threads


Catherine Miale

January 13, 2016 at 5:01 pm

I created a custom snipit. I have the code to prevent Infusionsoft from pulling over unapproved contacts. I should be able to put more functions in the same snipit no? Any idea wwhat this isn’t working?

/**
* Filters the $is_contact_data before it’s sent to infusionsoft
* in order to add the last registration’s custom question answers
* @param array $is_contact_data
* @param EE_Attendee $ee_attendee
*/
function espresso_infusionsoft_save_date_field($attendee_data) {

$clean_attendee_data = array(

//Example of a custom contact data field

//NOTE: You must prepend custom field database names with an underscore when accessing them through the API

‘_InstructorTrainingDate’ => $attendee_data[‘start_date’],

);

return array_merge($attendee_data, $clean_attendee_data);

}

add_filter( ‘filter_hook_espresso_infusionsoft_extra_attendee_data’, ‘espresso_infusionsoft_save_date_field’, 10, 1 );

(www.rippedcertification.com)


Josh

  • Support Staff

January 13, 2016 at 5:22 pm

Hi Terry,

It turns out that the filter hook at the end of the code there is a hook that’s only present in Event Espresso 3. This is a reference that shows an example of using the equivalent hook for Event Espresso 4.

Along with that, you should check to make sure that $attendee_data[‘start_date’] has an actual value set.


Catherine Miale

January 13, 2016 at 5:37 pm

You’re directing me back to the same code I copied. And in one spot you say ‘website’ is the Infusionsoft name, and the following paragraph you say it is the EE name… ?


Catherine Miale

January 13, 2016 at 5:39 pm

And also isn’t the start date the date of the event for which they are registering?


Josh

  • Support Staff

January 13, 2016 at 5:47 pm

Hi there,

Please take a closer look at the code. The code I’m directing you uses the FHEE__EED_Infusionsoft__save_infusionsoft_attendee__extra_attendee_data hook, your code uses the filter_hook_espresso_infusionsoft_extra_attendee_data hook. There is a difference.

And also isn’t the start date the date of the event for which they are registering?

Correct, but is that a valid way to get that data?


Catherine Miale

January 13, 2016 at 6:20 pm

I’m taking code from the forums and documentation and following directions to implement it.

Correct, but is that a valid way to get that data?

That would be a question I’d have to ask you.


Josh

  • Support Staff

January 14, 2016 at 9:44 am

It isn’t unless you’re setting up the data elsewhere. The code in this gist shows one way to get the event date:

https://gist.github.com/joshfeck/3fb137494e100abc925c

I mentioned this in your other support thread, but it bears repeating, that the Infusionsoft API does not seem to accept an incoming date for the Date field, even if the format matches exactly. So you may need to use a Text type custom field for the Class Date.


Catherine Miale

January 14, 2016 at 9:58 am

Yes, this was the question I was just looking for. When we used Magento the date was pulled into the Date field as a Date field. If it is a text field, we can’t search for events by Date range, or kick off e-mails based on the date. Which is the whole point of bringing the date over.


Josh

  • Support Staff

January 14, 2016 at 10:05 am

Do you happen to have the code that was used in Magneto so we can take a look?


Catherine Miale

January 14, 2016 at 10:11 am

Unfortunately no. I can see if I can get it.


Josh

  • Support Staff

January 14, 2016 at 10:19 am

I think I have something that will work, one moment please.


Josh

  • Support Staff

January 14, 2016 at 10:24 am

Okay, I’ve updated the code in the gist and it uses a date format that the Infusionsoft API will actually accept.

Viewing 11 reply threads

The support post ‘Infusionsoft Event Date Code not working.’ 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.

Event Espresso