Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_gform_after_submission( $entry, $form ) {
- // 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' )
- );
- $contact_id_one = wp_fusion()->crm->add_contact( $contact_data, false );
- add_filter(
- 'wpf_crm_object_type', function( $object_type ) {
- return 'Lead';
- }
- );
- // 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' ),
- 'Company' => 'Foo',
- );
- $contact_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