Allow Notification Email Fields to Handle Extra Commas

I keep running into an issue where I have an email address and a non-required email merge tag in a Notification’s email fields. When the merge tag is blank, the trailing comma causes issues and the email doesn’t send.

I am currently using conditional logic and 2 separate notifications, but that is annoying to keep updated. It would be much more intuitive and efficient if GravityForms could automatically remove any extra commas as needed.

Ran into this issue again on another form…It must be possible to automatically scrub any trailing commas from the “To:”, “CC:” & “BCC:” fields…

I found out that some third-party SMTP WordPress plugins (eg. “WP Mail SMTP”…not sure about the recommended ones here: https://docs.gravityforms.com/troubleshooting-notifications/#use-smtp) can automatically scrub extra commas…But GravityForms doesn’t send the email addresses to wp_mail() if it detects extra commas.

Please remove the validation check so fields with extra commas still get sent to wp_mail()

1 Like

I’ll open a ticket for this support ticket for this request. Thanks again.

@chrishajer, I don’t think I have seen this support ticket yet.

Sorry, it was an internal support ticket with the development team. It was not in your name. You would not have been updated.

@chrishajer, Any updates from the development team? This is causing me a lot of frustration and I suspect is should be a relatively straightforward fix.

There has not been any activity on the issue because there is currently a work around (multiple notifications when you are sending to a non-required email field). There was only one other request for the feature, which was well before your request, and it has not been considered a high priority. I’ll make a note that you checked in again today.

@chrishajer, I would suggest that many more of your users are facing this issue without realizing it because no error message is generated. At the very minimum, there should be a clear error message to the site admin when the CCed or BCCed recipients are removed by Gravity Forms before sending to the wp_mail() function.

I think this is similar to the lack of error messages generated by MailChimp when birthdays are formatted incorrectly (resolvable, but not obvious) or a previously unsubscribed email address is rejected by MailChimp.

I don’t understand why Gravity Forms doesn’t have the option to trigger a notification whenever a significant error occurs like the ones outlined above.

@chrishajer, It looks like I finally figured out the small edit that allows comma-separated lists of email addresses to properly send even if they include trailing commas. I simply had to make one minor edit to function is_valid_email_list() in common.php as demonstrated here: http://snippi.com/s/wjmwd3h All I did was add “&& ! empty($email)”

Is there any reason why this minor edit can not be included in Gravity Forms’ official code? If so, could you please add a hook so allowing empty email addresses can be done without editing the Gravity Forms code directly after each future update?

I just got an email reply from Gravity Forms Support that this has been added to the feature request list, but I’m unclear why this improvement isn’t simple to review and add…I don’t want it to get stuck in the feature request list…

@chrishajer, Just following-up.

It’s still on the feature request list. It has not been reviewed or been incorporated in to Gravity Forms at this time.

I just received the following from Gravity Forms Support “we currently have no active plans to implement the request.”

I find this response extremely disappointing. I have been requesting this feature since Feb. 13, 2017. After much frustration and a bunch of work, I finally identified a TINY code change that can fix this issue…And there are “no active plans to implement the request”.

Since this limitation generates are no warnings or error messages, this issue is impacting users without them even being aware of it. I just can’t understand why this minor change can’t simply be included in the official code.

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.