Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- node_import_pardot_settings() {
- $nid = 0;
- //find the node id of the contact webform
- $query = "SELECT nid FROM node where type = 'webform' ORDER BY nid DESC";
- $result = db_query($query);
- //yes this will override every nid, but upon install there should only be a single webform
- //so it doesn't matter. We don't know it's title yet either so we can't filter anyhow.
- foreach($result as $record) {
- $nid = $record->nid;
- }
- //if a webform has been found, insert the pardot integration data for programmatic setup.
- if($nid != 0) {
- $data = 'a:10:{s:18:"i_am_interested_in";a:1:{s:3:"key";s:18:"i_am_interested_in";}s:16:"question_comment";a:1:{s:3:"key";s:16:"question_comment";}s:14:"e_mail_address";a:1:{s:3:"key";s:14:"e_mail_address";}s:10:"first_name";a:1:{s:3:"key";s:10:"first_name";}s:9:"last_name";a:1:{s:3:"key";s:9:"last_name";}s:7:"company";a:1:{s:3:"key";s:7:"company";}s:12:"phone_number";a:1:{s:3:"key";s:12:"phone_number";}s:4:"city";a:1:{s:3:"key";s:4:"city";}s:28:"state_province_region_county";a:1:{s:3:"key";s:28:"state_province_region_county";}s:7:"country";a:1:{s:3:"key";s:7:"country";}}';
- $endpoint_url = 'http://go.pardot.com/l/14762/2015-02-03/4l25n7';
- $is_active = 1;
- $query2 = "INSERT INTO pardot_webform (nid, url, is_active, data)
- VALUES (:nid, :endpoint_url, :is_active, :data)";
- $result2 = db_query($query2, array(':nid' => $nid, ':endpoint_url' => $endpoint_url, ':is_active' => $is_active, ':data' => $data));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement