"Email Email" isn't a valid email address on Form submissions via Forms API

forms

#1

We're seeing a weird error message on all form submissions, see screenshot:

Error message: This value wasn't passed to the contact record. 'email@email.com email@email.com' isn't a valid email address.

Despite throwing an error notification, the form submission seems to be correctly attaching itself to the user with the non-duplicated version of their email address. Afaik, we haven't changed the way we use the Forms API and we never saw this error messages until about ~1 month ago.

Is anybody else seeing this issue? Any ideas on how to solve this?


#2

Hi @nicolai - Can you provide more detail about the actual request that's being made (particularly the raw request URL, headers, and body)


#3

@Robert_Ainslie

opening connection to forms.hubspot.com:443...
opened
starting SSL for forms.hubspot.com:443...
SSL established
<- "POST /uploads/form/v2/1551245/41aa66ed-e3d8-4343-babf-50a1774ee439 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nConnection: close\r\nHost: forms.hubspot.com\r\nContent-Length: 2035\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n"
<- "birth_day=3&birth_month=2&birth_year=2004&code=&cohort_id=QU1TQ29ob3J0LTU2&cohort_name=San+Francisco+Summer+Academy&email=test7-3.e%40makeschool.com&firstname=test7-3&friend=&gender%5B%5D=female&lastname=test7-3&race%5B%5D=americanIndianOrAlaskaNative&year_2017_app_idea_or_improvement=test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+&year_2017_city_of_residence=asdf&year_2017_coding_level=newbie&year_2017_country_of_residence=Albania&year_2017_explain_things_built=test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+&year_2017_highest_education_level=Middle+School&year_2017_i_am_older_than_13_checkbox=true&year_2017_middle_school_name=asdfasdf&year_2017_phone_number=234457789&year_2017_us_citizenship_type=US+Citizen&year_2018_sa_explain_referral=test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+&year_2018_sa_happiness_with_access_to_cs_education=test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+test+&year_2018_sa_housing_interest=I+am+local+to+San+Francisco+and+do+not+need+housing&year_2018_sa_ios_or_web%5B%5D=iOS+development+track+%28Swift%2C+Apple+computer+required%29&year_2018_sa_own_macbook=Yes&year_2018_sa_referral_sources%5B%5D=Google+Search&year_2018_sa_scholarship_interest=No&zip=234q3452&form_status=submitted&email=test7-3.e@makeschool.com&hs_context={}"
-> "HTTP/1.1 302 \r\n"
-> "Date: Wed, 04 Jul 2018 00:14:05 GMT\r\n"
-> "Content-Length: 0\r\n"
-> "Connection: close\r\n"
-> "Set-Cookie: __cfduid=d415b9a6a85042364218fa055371eb4671530663245; expires=Thu, 04-Jul-19 00:14:05 GMT; path=/; domain=.hubspot.com; HttpOnly\r\n"
-> "Access-Control-Allow-Credentials: false\r\n"
-> "Cache-Control: max-age=0, no-cache, no-store\r\n"
-> "Location: https://www.makeschool.com/apply/thank-you?id=41aa66ed-e3d8-4343-babf-50a1774ee439&submissionGuid=1363e567-f2f9-4112-bb81-7c5d14e5a1ac\r\n"
-> "X-Trace: 2BFB7093332BC0F5D0314594D9363A3FE3649C86EB000000000000000000\r\n"
-> "Strict-Transport-Security: max-age=2592000\r\n"
-> "Expect-CT: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"\r\n"
-> "Server: cloudflare\r\n"
-> "CF-RAY: 434d63c4ec6b6d66-SJC\r\n"
-> "\r\n"
reading 0 bytes...
-> ""
read 0 bytes
Conn close

#4

Hi @nicolai,

Looking at the request body, it appears that you are including the email parameter 2 times. If you do a search on that response for email=test7-3.e%40makeschool.com and you'll see it represented twice.

Your code should be fixed so that email is only included once in the request body.