将表单提交从 InfusionSoft 迁移到 Hubspot

Migrate submission of form from InfusionSoft to Hubspot

我在 Orchar CMS 中有一个表单,使用 ViewModel 构建,目前它获取数据并使用 InfusionSoft 提交,现在,我需要将该提交方法迁移到 Hubspot,我找不到我想要的我正在 api 文档中寻找,但我需要迁移它,但我找不到如何执行此操作的示例,任何建议或 link 我可以指导自己的地方!?!? .这是我的表单示例:

public class CreateTrialUserHubspotViewModel {

    [StringLength(50), Required, Display(Name = "First Name")]
    public string FirstName { get; set; }

    [StringLength(50), Required, Display(Name = "Last Name")]
    public string LastName { get; set; }

    [StringLength(50), Required, Display(Name = "Job title")]
    public string JobTitle { get; set; }

    [Display(Name = "inf_option_countryreport")]
    public bool Country_Reports { get; set; }

    [Display(Name = "inf_option_Economicmodel")]
    public bool Economic_Models { get; set; }

}

然后我有一个控制器获取所有数据并提交它,这里是我控制器的注册方法中的一个示例(这不是完整代码)

[HttpPost, Themed]
    public ActionResult Register(CreateTrialUserViewModel newTrialUser) {    
        //Load Form values in this collection
        NameValueCollection formData = new NameValueCollection();
        formData["inf_form_xid"] = infFormXis;
        formData["inf_form_name"] = infFormName;
        formData["infusionsoft_version"] = infVersion;

}

这里可以尝试两种策略:

Using an Embeddable HubSpot Form (Simpler approach)

You can create an embeddable 5-field form that sends data to HubSpot ONLY -- instructions in this user guide: https://knowledge.hubspot.com/forms-user-guide-v2/how-to-create-a-simple-form


Submitting data from a custom form to HubSpot (More inline with your current approach)

If you prefer to create the form in C# and Orchard, you can do that too. Create the form the way you would normally for your CMS, than send data to HubSpot using the Forms API and Submit Data endpoint: http://developers.hubspot.com/docs/methods/forms/submit_form

包括示例 C# 代码。享受吧!