Support

Home Forums Event Espresso Premium Sending Course Dates to Custom Field in Infusionsoft

Sending Course Dates to Custom Field in Infusionsoft

Posted: May 28, 2014 at 3:48 pm


infosolwebadmin

May 28, 2014 at 3:48 pm

I have the infusionsoft plugin and I am looking to send time based emails for our courses (2 weeks and 2 days prior to their start date) via infusionsoft (I’ll refer to it as IS from here on out). I could go in and create a campaign for each instance of a course and manually insert the dates when those particular emails need to go out, but that seems like a lot of unnecessary work. IS has a ‘Field Timer’ option in their campaign builder: http://ug.infusionsoft.com/article/AA-01159/0/Configure-a-Field-Timer-in-a-campaign-sequence.html which allows you to schedule something based off of a field that contains a date.

So, if EE could send over the start date of a course to the contact record in IS when someone registers and insert it into a custom (date) field, I could use that date field to trigger the emails via the Field Timer. That in itself doesn’t seem too far fetched, but there are some other issues that I can think of based off of what I’ve learned using EE and IS thus far:

I would need to make a custom date field for each course that we offer in the contact record of IS (we offer around 15 different courses). If there was only one general ‘course date’ field and someone registered for two courses, the first courses date would get overwritten by the second one and that’d mess up the timing. But that brings up another issue, there would have to be some way for EE to know which date field to put the date into based off of which event the person is registering for. I’m not sure how that’d work, do you have any ideas? I know at the very least I can send out time based emails, but I’d really like to automate that process so I don’t have to build a new email campaign every time we add a new date for our courses. If my idea with the custom date field works, then I’d be able to create one campaign per class and tell it to send the emails X amount of days prior to the custom date field.

I also think adding the functionality to be able to send time based emails inside EE for each course would be a universally loved functionality for EE users. But for now it looks like IS is my best option to accomplish that

Thanks for the help!


Josh

  • Support Staff

June 2, 2014 at 6:47 pm

Hi Yolande,

This is diving into customization territory, but we do have a hook that allows for sending info like a course date to IS. Some example code follows, that you could adapt and add to your custom file add-on’s custom_functions.php file or in a custom snippet plugin:

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 '_CustomDateField' => $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 );


infosolwebadmin

June 3, 2014 at 7:08 pm

Thanks Josh. My programming skills are pretty basic, but I’d imagine there is a way to add code into that to conditionally determine what custom field the date gets sent to? IE if the course category ID equals ‘XXXX’ then it’d get sent to ‘XXXX’ field in IS. That’s the only potential hangup I see, if every registration sends a course date to the same field in IS then it’ll get overwritten if they register for multiple courses at once. If I can send the date to a specific field in infusionsoft based off of a course category ID for example that’d pretty much solve that problem.

Thanks!


Josh

  • Support Staff

June 3, 2014 at 8:46 pm

Hi Yolande,

There is a way to do this and it does require some basic PHP programming skills.

If you have more than a few different categories, a switch would be a good way to go. The category IDs (cat_ID) for the event can be pulled from the _events_category_rel table. Since the $attendee_data array is available to be used, you can use $attendee_data->event_id in the query to grab the event’s category. If you’re not too familiar with writing custom queries, I highly recommend this tutorial:

http://www.smashingmagazine.com/2011/09/21/interacting-with-the-wordpress-database/

Along with that, to help keep this simple, I’d suggest assigning only one unique category that will be in the switch per event.

The support post ‘Sending Course Dates to Custom Field 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