Support

Home Forums Event Espresso Premium Event a Day Late In Infusionsoft

Event a Day Late In Infusionsoft

Posted: June 16, 2016 at 8:33 pm


Carl Bischoff

June 16, 2016 at 8:33 pm

We have event in EE4 in WOrpdress

When a person registers in Event Espresso the course date lands in Infusionsoft and populates the field with a date one day prior to the date of the event in EE

This creates an issue with first email to client from IS showing the incorrect date.


Lorenzo Orlando Caum

  • Support Staff

June 17, 2016 at 7:50 am

Hi Carl,

Could you share some feedback on where that date is being added so I can run some additional testing?

I’m seeing an entry for a date, however its the order date rather that the event date.


Lorenzo


Carl Bischoff

June 19, 2016 at 4:12 am

Thanks the event date is being recorded and sent to the client from ee4 correctly but in infusionsoft it is a day earlier [goes into a custom field]
E.g 17th June event shows in Infusionsoft as 16th in Custom Event date filed.


Carl Bischoff

June 19, 2016 at 4:17 am

link to event showing event date; https://drive.google.com/file/d/0B3hl7otgVtKkRjZKWTJacTZlM0k/view?usp=sharing


Tony

  • Support Staff

June 20, 2016 at 4:52 am

Hi Carl,

Can you let me know which timezone you have set within your site please?

Dashboard -> Settings -> General -> Timezone.


Tony

  • Support Staff

June 20, 2016 at 7:22 am

Also can you post up the code you are using to add the date to a custom field please?

You can either create a Gist or use something like PasteBin and post the URL here for us to view.


Carl Bischoff

June 23, 2016 at 8:01 pm

Here is a link to date https://drive.google.com/file/d/0B3hl7otgVtKkbHlEZWY1LS1qaWc/view?usp=sharing
Will update re coding


Carl Bischoff

June 23, 2016 at 9:04 pm


function ee_infusionsoft_pass_event_start_and_name( $is_contact_data, $ee_attendee ) {
    if( $ee_attendee instanceof EE_Attendee ) {
    $startdate = '';
    $eventname = '';
    $checkout = EE_Registry::instance()->SSN->checkout();
        if ( $checkout instanceof EE_Checkout ) {
            $transaction = $checkout->transaction;
            if ( $transaction instanceof EE_Transaction ) {
               foreach ( $transaction->registrations() as $registration ) {
                    if ( $registration instanceof EE_Registration ) {
                        $event = $registration->event();
                        if ( $event instanceof EE_Event ) {
                            //get the event start date
                            $startdate = date( EED_Infusionsoft::IS_datetime_format, $event->primary_datetime()->get_raw( 'DTT_EVT_start' ) );
                            //get the event name
                            $eventname = $event->name();
                            $is_contact_data[ '_CourseDate' ] = $startdate;
                            $is_contact_data[ '_CourseTitle' ] = $eventname;
                        }
                    }
                }
            }
        }
    } else {
        EE_Error::add_error(sprintf( __( 'ee_infusionsoft_save_my_custom_questions was not called with an EE_Attendee but a %s', 'event_espresso' ), gettype( $ee_attendee )), __FILE__, __FUNCTION__, __LINE__ );
    }
    return $is_contact_data;
}
add_filter( 'FHEE__EED_Infusionsoft__save_infusionsoft_attendee__extra_attendee_data', 'ee_infusionsoft_pass_event_start_and_name', 10, 2 );
  • This reply was modified 5 years, 5 months ago by  Tony. Reason: Code formatting


Tony

  • Support Staff

June 24, 2016 at 4:53 am

$startdate = date( EED_Infusionsoft::IS_datetime_format, $event->primary_datetime()->get_raw( ‘DTT_EVT_start’ ) );

I think this is the problem.

All dates and times are stored within the database in UTC+0, so your pulling the value directly from the datebase and sending that to Infusionsoft, meaning your not getting the value your are expecting.

Try:

$startdate = date( EED_Infusionsoft::IS_datetime_format, $event->primary_datetime()->start_date_and_time() );

Did you use one of our examples to build the above?


Carl Bischoff

June 29, 2016 at 2:48 am

Hi,

$startdate = date( EED_Infusionsoft::IS_datetime_format, $event->primary_datetime()->start_date_and_time() );

We try that code but it returns empty.


Tony

  • Support Staff

June 30, 2016 at 9:05 am

Hmm, in that case there is something about the date format your site uses that date doesn’t like.

Another option is to use:

$startdate = $event->primary_datetime()->start_date( EED_Infusionsoft::IS_datetime_format );

The start_date method will automatically apply your timezone offset, passing the IS_datetime_format to that method returns the date in that format.


Carl Bischoff

July 14, 2016 at 2:02 am

ok success thankyou


Tony

  • Support Staff

July 14, 2016 at 3:18 am

You’re most welcome.

I’ll mark this thread resolved.

The support post ‘Event a Day Late In Infusionsoft’ 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