I have no experience with hooks and action... and need some direction.
So here is what I need..
One of my question in my form is to ask if the client want to subscribe to our newsletter, if they do, we'll send an email to aweber to subscribe the client
I've been using cform up until today... this is the code that I used in cforms
if ( $formID == '2' ) {
if ($form['Receive Newsletter?'] == 'Yes') {
$msg_body = "HLE Subscription\n".
'Name: '.$form['First Name*']."\n".
'Email: '.$form['Email*']."\n";
@mail('hle@aweber.com', 'HLE Subscription', $msg_body, 'From: admin@homeloanexperts.com.au');
}
}
however i'm not sure how to do it when i need to use add_action.. a few questions here
should i use 'gform_pre_submission' or 'gform_post_submission'?
how do I refer to the form in the function?
function subscribe($form) {
...
}
is this correct?
do i place the function in functions.php in my theme folder?
and when in the function
do I refer the first name as $form[input_5.3]?
the 'dot' just seems a bit weird to me.
thank you for your help