Skip to content
Advertisement

Gravity Forms add attachment to user notification

I am using the following code from Gravity forms to attach a file to the user’s notification:

JavaScript

In addition to adding an attachment to form 55, as shown in the example, I need to add a different attachment to a different form. I have changed the form ID to reflect this and copied/pasted the code into the functions file a second time, but the site breaks in doing so. The above works as expected, on it’s own. How can I use the filter multiple times?

Advertisement

Answer

The absolute simplest way (but not the prettiest) would be to duplicate everything and change the function name. Here’s an example where I update the function name in both instances to match the form ID:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement