Dynamically send form submission notifications

We use the form embed code to display forms across our site. We are looking to dynamically send form submission notifications based on where the lead came from. The current idea is to use a url string to pre populate potentially a hidden field and then somehow use that to trigger the notification email once submitted.

Is there a way to use onFormSubmit, to alter who receives a form submission notification?

Hi @amjones2,

This was covered in an earlier thread, I believe this is what you’re looking for.

Hope this helps!

This isn’t exactly what I am after. This is a good solution to take a value from the url, but what i am after is looking at a url string (lets say something like ?lead=someone@email.com) and taking that email value and sending the form notification email to that email address. This would be a way to send our various business development people any leads their pages generate without having to make a new form for each person.

Hi @amjones2,

You can pass on parameters with the form submission following these steps: How to pass UTM parameters into a HubSpot form | Align.ly

However, you cannot influence who is being notified based on these parameters directly.

This would require a Professional or Enterprise subscription which is looking at the string/parameter and triggering an internal email send based on that.

Without a Professional subscription and without workflows, this is currently not possible out of the box. It would require more extensive development, more than a few lines of code leveraging the forms API.

Let me know if you have any follow-up questions!

We do have a professional account. How would I go about doing this? Is there some documentation out there that I could reference?

Hi @amjones2,

Not specifically but I can outline the steps for you.

First, you need to set up a custom property for the parameter you want to use, as explained in this article: How to pass UTM parameters into a HubSpot form | Align.ly

For my example in the screenshot below, this property is called (very creatively) “Single-line text”.

You would then create a contact-based workflow which looks like this:

The enrollment trigger is the submission of the form that you’re setting this up for. When you click on “Contact enrollment trigger”, the right sidebar should pop open. Select the tab “Re-enrollment” and make sure that re-enrollment is enabled for repeated form submissions.

Additionally, I would add the criterion that your custom property from above should be known.

In a next step, you would create an if/then branch which checks the value in your custom property passed on from the form. You will then simply map the value to a user in HubSpot. If the email address is email1@domain.com, send an internal email to the corresponding user. (In my screenshot it says Contact owner but that’s where you can select any user in your HubSpot portal.)

(It is not possible to have HubSpot read the email address from the property directly and send an email there. It might seem redundant but it’s the only way.)

For each recipient, you would have to create one branch, I stopped at two.

Also, since you’re mapping the property to a recipient, the parameter value doesn’t need to be the email address, it could also be another key.

If you need more info on the workflow actions and what they do, this knowledge base article will help: Choose your workflow actions

Let me know if you have any follow-up questions!

“(It is not possible to have HubSpot read the email address from the property directly and send an email there. It might seem redundant but it’s the only way.)”

This was the ultimate question I was after. Thank you for answering. I did know about the workflow setup but was hoping of a dynamic way to trigger the emails vs setting each one up individually. We have potentially hundreds of people that could generate the leads and I don’t think the workflow setup is tenable and would be problamtic to maintain as people join/leave the company. Thank you for your replies!

Hi @amjones2,

Agreed, for a potentially long list of email recipients this wouldn’t work. At this stage, this would be the only out-of-the-box solution.

The alternative would be custom code actions in workflows, requiring development and an Operation Hub Professional subscription.

If you think my posts were helpful and consider this thread closed, you could accept this post as a solution. I’d appreciate it!

Best regards!