Yes, we can do this by creating a custom workflow, once the workflow is created then it will be listed in the workflow section of the Umbraco form, then just configured the created workflow to the corresponding form.
But keep in mind that the form data will save even if there is an issue occurred at the time of posting the data to HubSpot.
Example
public class CustomFormFlow : WorkflowType
{
public CustomFormFlow()
{
this.Id = new Guid("ccbeb0d5-adaa-4729-8b4c-4bb439dc0203");
this.Name = "Custom Workflow ";
this.Description = "This is a custom workflow";
this.Icon = "icon-flash";
this.Group = "Services";
}
public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
{
try
{
//param `record` has all the data
//you can read the value
record.GetRecordFieldByAlias("aliasName")?.ValuesAsString();
var status=postDataToHubspot();
if (status)
return WorkflowExecutionStatus.Completed;
else
return WorkflowExecutionStatus.Failed;
}
catch (Exception ex)
{
Current.Logger.Error<CustomFormFlow >(ex, "Error in CustomFormFlow ");
throw;
}
}
Umbraco Forms submissions to Hubspot
Hello!
Is there any way to send data submitted in a Umbraco form to Hubspot?
You would need to create a custom workflow to handle this.
https://our.umbraco.com/documentation/Add-ons/umbracoforms/developer/extending/adding-a-workflowtype
Hi Stefan,
Yes, we can do this by creating a custom workflow, once the workflow is created then it will be listed in the workflow section of the Umbraco form, then just configured the created workflow to the corresponding form.
But keep in mind that the form data will save even if there is an issue occurred at the time of posting the data to HubSpot.
Example
Regards Dhanesh ;)
is working on a reply...