If you are using PHP nodes you can include phpHelperfunctions.php to provide a number of key, useful FunnelFlux functions.
You can include this by adding this to the start of your PHP snippet:
require_once 'PHPNodeHelpers.php';
The functions available are after this are:
- PHPNodeHelpers::accumulateParam($key, $value)
- PHPNodeHelpers::loadAccumulatedParams()
- PHPNodeHelpers::saveAccumulatedParams($params)
- PHPNodeHelpers::loadTrackingFields()
- PHPNodeHelpers::updateTrackingFields($fields)
- PHPNodeHelpers::sendMail($config);
These do the following:
- accumulateParam will add specified key/value pairs to the Accumulated URL Params buffer
- loadAccumulatedParams will load the Accumulated URL Params buffer as an array
- saveAccumulatedParams will save and replace the current URL Parmas buffer with whatever is in the specified array
- loadTrackingFields will load all tracking field data available for the current visitor
- updateTrackingFields will update any custom tracking fields for the current visitor to the values specified (the tracking fields must however exist)
- sendMail allows to send emails through an SMTP server of your choice. The config array to pass to the function requires the following entries:
PHPNodeHelpers::sendMail( [
'to' => 'you@you.com',
'email-subject' => 'Open this now',
'email-body' => 'The html email content',
'smtp-configuration' => [
'server' => 'your-smtp.server.com',
'port' => 'port number',
'secure' => 'ssl',
'username' => 'username to smtp service',
'password' => 'password to smtp service',
'from-name' => 'Me',
'from-email' => 'me@me.com',
]
] );