We manage a ton of sites for our clients and often when we or they set up a form we forget to disable the default Admin notification.
This means we get an email with “New submission from {form_title}” - however we have absolutely no idea of which site the form is actually being sent from.
Would it be possible to set the default notification to be “New submission from {site_name}: {form_title}” or alternatively have the main content to show:
{all_fields}
via: {embed_url}
Here’s the code I use for custom merge tags. Makes use of the gform_replace_merge_tagsfilter, not linked above. I currently have both {site_url} and {site_name} as options.
Hi Joshua,
I tried your code in both, functions.php of the theme and also creating a new file under the GF folder that I named " gf-custom-merge-tags.php" as I noticed you did but none of those case scenarios resulted in seeing the Site Name or Site URL in the drop-down options under the Notifications settings, am I missing other steps or something else?
This code only makes them available for use. It doesn’t explicitly add it to the dropdown. The full code, both for powering the merge tags and getting them listed w/in the dropdown can be found here:
AH! Thank you Joshua! The code worked once added to the theme’s functions.php file, but let’s say we wanted a more centralized location to host these mods such as in that “gf-custom-merge-tags.php” file, or was this strictly a custom approach you setup on your end?
I bookmarked that awesome snippets page full of neat mods
UPDATE: Issue confirmed due to GF 2.5 and PHP 8.0, I reverted back to Php 7.4 and GF 2.4 for now until things settle
I just updated to GF 2.5 and this snippet no longer works, furthermore I was getting the following warnings on the front-end wherever a GF form was loaded: “Warning: Trying to access array offset on value of type bool in…” pointing to the theme’s functions.ph file where I placed the snippets.
I downgraded the Php version of the site from 8 to 7.4, the warnings are gone, but still no merge tags showing up in the drop-downs.
Just to help isolate if the issue is on my end or not, can someone please validate the compatibility with GF 2.5? Otherwise I think I will revert back to GF 2.4 and wait for a more stable version.
Date/Timestamp/Site URL and Site Name no longer appear in the drop-down
@FanaticWeb I’ve updated the script on snippet.farm to work with Gravity Forms 2.5. The previous code was improperly using an available GF filter to print content to the page. The current code shown takes a more reliable approach.