Discussion Forums

How to add an Event with Form Submission

 
Avatar
New Member
5 posts

I find it useful to ad an event activity to schedule a follow up when a contact form is submitted. Based on the example provide in the API Introduction I added the following modifications just below the optional “Adding a note activity” area.

Here is the example code to ad an event activity…

// You can ad an event activity to schedule an event.

    // set the default timezone to use. 
    
date_default_timezone_set('EST');


    
// Preparing data for the task
    
$eventData = array(

    
// Required Feilds
    
'timestart'     => date("Y-m-d"),    // (date or datetime)
     
'timeend'     => date("Y-m-d"),    // (date or datetime)
     
'priority'         => 0,                // (ingeter, [0-6])
     
'remindtime'     => 0,                // (integer, [0, 1])
     
'eventtype'     => 'keep',            // (text, [keep, remove])

     // Optional Feilds (Remove as needed)
     
'title'         => 'Follow-up on Form Submission',    // (text)
     
'attendees'     => '{####},{####}',     // (integers delimited by comma, [user id])
     
'externalattendees' => '{email1},{email2}',    // (email addresses delimited by comma)
     
'repeats'         => 'weekly',        // (text, [{blank}, daily, weekly, monthly, yearly])
     
'repeatevery'     => 1,                // (integer when repeats 1= weekly)
     
'repeatinterval'=> '1,2,3,4,5',  // (integers separated by comma when repeats = week days 0-6)
     
'repeatuntil'     => '2010-5-31',        // (date)
            
    
);

    
$event $solve360Service->addActivity($contactId'event'$eventData);
    
    
// Mail yourself the result
    
mail(
        
USER
        
'Event was added to "' $contactName '" contact in Solve360',
        
'Event with id ' $note->id ' was added to the contact with id ' $contactId
    
);
    
   
// End of adding event activity 

Avatar
Administrator
3951 posts

Looks good, thanks for sharing this.