Sorry about the delay. Here's what I did in functions.php (you may need to use theme-functions.php based on how your theme does it):
You will need to change the 19 on line 2 to your form ID.
You will need to change 3 on line 6 to your field ID. I used a multiple choice field (radio buttons) to accept just one request for PDF.
[There is nothing to add anywhere else. This function is a filter which just modifies values submitted with this form. There is no function to be added anywhere else.]
When I set up my multiple choice field, I chose to use values to avoid issues with the values having capital letters and spaces. So, my values are beltguard, safetyguard and catalogue. You could use numbers there, or the actual names of your PDF to use later as variable replacements.
So, based on the value of input_3, I append to the email notification the link to the PDF I want to send. I set up the user email notification the same as always, but just left a blank line and the end and then this function adds a link to the end of the email body. I disabled auto-formatting for the notification and added my HTML manually (which is why there is a closing < /p> after the link in functions.php) Then, return the modified form object with the PDF link inserted into it.
Hopefully that will get you pointed in the right direction. If you need more help please let us know. Thanks.
Posted 11 years ago on Friday August 12, 2011 | Permalink