Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_gform_after_submission( $entry, $form ) {
- add_filter( 'wpf_crm_object_type', function( $object_type ) {
- return 'MyObjectType';
- } );
- // Gets the first name and last name from field ID 3, and email from field ID 4
- $contact_data = array(
- 'FirstName' => rgar( $entry, '3.3' ),
- 'LastName' => rgar( $entry, '3.6' ),
- 'Email' => rgar( $entry, '4' )
- );
- $object_id_one = wp_fusion()->crm->add_contact( $contact_data, false );
- // Gets the first name and last name from field ID 5, and email from field ID 6
- $contact_data = array(
- 'FirstName' => rgar( $entry, '5.3' ),
- 'LastName' => rgar( $entry, '5.6' ),
- 'Email' => rgar( $entry, '6' )
- );
- $object_id_two = wp_fusion()->crm->add_contact( $contact_data, false );
- }
- // Replace "1" with the ID of the form
- add_action( 'gform_after_submission_1', 'my_gform_after_submission', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement