| Post |
|
Guest
| tate 1:45 pm December 19, 2008
| |
|
|
Please replace the ??? with your data!
- URL to the FORM: http://???
- The browser used: ???
- cforms version: cforms1.4
- Your Wordpress version: 2.6
[desc]: Wondering if anyone can help me with the my_functions.php.
I only have one form so I'm sure this line is the ok:
if ( isset($POSTdata['sendbutton']) ) {
I have tried sendbutton1 and sendbutton2, but that does not work.
The @mail has a correct email address, but somehow this function is not sending me any emails when I submit a form. Do I have to change anything else? or am I missing something??
Help!
|
|
|
Admin
| Oliver Munich, Germany posts 6237 6:40 pm December 19, 2008
| |
|
|
what's your url?
what do you want to achieve?
why the use of my_functions.php?
|
|
|
|
|
Guest
| tate 7:32 am December 21, 2008
| |
|
|
url is cleardebtadvisors.co.uk
I wanted to use the my_functions to send form data and other info appended to it to other email addresses. Also I just wanted to get this function working so I can build upon it.
But I don't recieve any email's from this function!
the code I have put is this::
### ### Your custom user data input filter (non ajax) ### function my_cforms_filter($POSTdata) {
### triggers on your third form if ( isset($POSTdata['sendbutton']) ) {
### do something with field name 'cf3_field_3' ### (! check you HTML source to properly reference your form fields !) $POSTdata['cf3_field_3'] = 'Mr./Mrs. '.$POSTdata['cf3_field_3'];
### perhaps send an email or do somethign different @mail('myemail@gmail.com', 'cforms my_filter_nonAjax test', 'Form data array (nonAjax):'.print_r($POSTdata,1), 'From: your@blog.com'); } return $POSTdata;
}
Where am I going wrong? and I am only using one form so I guess 'sendbutton' is correct.
I also tried this function, but that did not work either(using $formID='', as this is the first form):
### ### Your custom user data input filter ### function my_cforms_action($cformsdata) {
### Extract Data ### Note: $formID = '' (empty) for the first form!
$formID = $cformsdata['id']; $form = $cformsdata['data'];
### triggers on your third form if ( $formID == '' ) {
### Do something with the data or not, up to you $form['Your Name'] = 'Mr./Mrs. '.$form['Your Name'];
}
### Send to 3d party or do something else @mail('myemail@email.com', 'cforms my_action test', print_r($form,1), 'From: your@blog.com');
}
Appreciate any help to get these functions working. :)
|
|
|
Admin
| Oliver Munich, Germany posts 6237 11:22 am December 21, 2008
| |
|
|
Silly question, but did you infact uncomment these functions? By default they're all commented out.
Also, start simple, in my_cforms_action()use the test example: @mail('myemail@email.com', 'cforms my_a…..
to send the entire, collected data to an email address of your choice.
Also, are you using cforms SMTP feature?
|
|
|
|
|
Guest
| tate 8:36 pm December 21, 2008
| |
|
|
Hey Oliver,
Thanks for responding.
No, the code was not commented out.
No I am not using the smtp option (good option to have though )
You say start simple, do you mean this exact code????:
function my_cforms_action($cformsdata) {
### Extract Data ### Note: $formID = '' (empty) for the first form!
$formID = $cformsdata['id']; $form = $cformsdata['data'];
### Send to 3d party or do something else @mail('mymail@gmail.com', 'cforms my_action test', print_r($form,1), 'From: your@blog.com');
}
The above code as is, does not work for me, I do recieve an email when someone fills in the form; subject line 'A comment from' but not from the above function with subject line 'cforms my_action test'. Where am I going wrong???
I am happy to pay you if you fancy going into my ftp/wordpress and sorting it out. What I really want to achieve is emailing a 3rd parties and putting the info into my autoresponder getresponse. I already got the script for it from my other site, I just need to match the variable up….interested???????
|
|
|
Admin
| Oliver Munich, Germany posts 6237 8:49 pm December 21, 2008
| |
|
|
I'm super maxed out at the moment and can't take on any other side projects, sorry I have to decline.
I'm happy to help though…I assume you replaced the mymail@… & the FROM: address in the same line with your details, otherwise your mail server may no relay the email properly.
ps: is the 3rd party always the same recipient for this form? if so, why not make him the admin (admin email) and put your own email into the BCC field?
if the "added info" is static, you can add it directly to the TEXT/HTML fields of your admin message settings.
|
|
|
|
|
Guest
| tate 10:21 pm December 21, 2008
| |
|
|
Man, fast response.
Super busy .. no worries .. I understand.
1) Yes, I have put my email in. The same one I put in the admin console
2) Yes, I understand I can put a BCC in. But thats not the route I want to take.
3) Yes, I understand I can put static text in the test/html fields, but thats not the route I want to take.
I want to use the my_functions, and trying to get it working.
Do you have any other ideas to get the function my_cforms_action($cformsdata) working??
I repeat, this is the code I put (with the real email), can yo confimr that it is correct ?:
function my_cforms_action($cformsdata) {
### Extract Data ### Note: $formID = '' (empty) for the first form!
$formID = $cformsdata['id']; $form = $cformsdata['data'];
### Send to 3d party or do something else @mail('mymail@gmail.com', 'cforms my_action test', print_r($form,1), 'From: your@blog.com');
}
If correct, any other ideas? How do I know that my_functions.php is being called?
|
|
|
Admin
| Oliver Munich, Germany posts 6237 10:54 pm December 21, 2008
| |
|
|
Usually to test (provided your PHP mail() is working fine) you only need to
- uncomment the routine
- adjust the test mail() command at the bottom
To see if it gets called at all,
- disable ajax for the form in question
- add a wp_die(print_r($form,1)); right after the line $form = …
- give it a shot
|
|
|
|
|
Guest
| tate 11:27 pm December 21, 2008
| |
|
|
hmm, it seems like my-functions.php is not being called!
I disabled ajax for the form, added the wp_die line after $form = $cformsdata['data'];
Refreshed my website, filled in the form, and just got the 'thank you for your comment' msg.
Any ideas?
|
|
|
Admin
| Oliver Munich, Germany posts 6237 12:22 am December 22, 2008
| |
|
|
Again, are you sure you un-commented the function…it really looks like it is still commented out (which it is by default!).
Feel free to send me your file, too.
|
|
|
|
|
Guest
| tate 1:10 am December 22, 2008
| |
|
|
do you have a private email address?
I'll just send you my details, it will be quicker that way!
Also, the functions are not commented out by default! I just re-installed 9.4, and have looked at my_functions under directory /wp-content/plugins/cforms.
|
|
|
Guest
| tate 1:38 am December 22, 2008
| |
|
|
MY BAD 
I double checked your last comment about commented code. And found that you did indeed comment most of the page. I assumed you meant the actual functions.
I did the uncomment and got the email

Getti ng there!
Thanks for getting me this far!
|
|