send email workflow.. anyway to get the referring page to the form page?
So a little more explaination we have a link on a product page to email the sales engineer...
so if a user then ends up at the contour form and sends an email, we'd like to say they came from this product page...
as the workflow is outside of the page context.. any ideas on how we can retrieve the referer?
in a standard form scenario... we'd be using
if (!Page.IsPostBack)
{
try
{
// try and store the referer so we can indicate how the user came to this form.
ViewState.Add("Referrer", System.Web.HttpContext.Current.Request.UrlReferrer.ToString());
}
catch { }
}
Yep custom code for workflow and updated renderform.ascx and renderform.cs (for new fieldtypes - which just discovered need to be replicated somehow on the mvc side for preview to work as get errors of no fieldtype specified)...
The partial view '/umbraco/plugins/umbracoContour/Views/Fieldtype.textfieldwithcompare.cshtml' was not found or no view engine supports the searched locations. The following locations were searched: /umbraco/plugins/umbracoContour/Views/Fieldtype.textfieldwithcompare.cshtml
Can I make a request for new documentation as the 1.1 pdf is a little behind??? and maybe also for you to release the source code for renderform.cs??? Also did the customisable templates from v5 (where you put cshtml files in the app_data/plugins/countour/guid/renderform.cshtml) make it back into v3 and is that just a mvc thing or maybe webform support too?
And yep already use the record id, but that just gives me the page that the form is on... not the page that the user was on immediately before the form... eg the refering page to the form page...
Only way I can see is to perhaps have a hidden field, and set the value on page load for the referer, then I can access that hidden field via the record in the workflow?
Was just asking though if any way to get the System.Web.Page context from the custom workflow class??
Ended up adding a hidden field and overriding the OnLoad or renderForm
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Page.IsPostBack)
{
try
{
// try and store the referer so we can indicate how the user came to this form.
ViewState.Add("Referrer", System.Web.HttpContext.Current.Request.UrlReferrer.ToString());
}
catch { }
}
FormStorage fs = new FormStorage();
var form = fs.GetForm(new Guid(this.FormGuid));
var fields = form.AllFields;
Umbraco.Forms.Core.Field refer = fields.Find(x => x.Caption == "Referring Page");
Control ctrlReferer = FindControlRecursive(rpFieldsets, refer.Id.ToString().Replace('-', '_'));
try
{
System.Web.UI.WebControls.HiddenField hf = (System.Web.UI.WebControls.HiddenField)ctrlReferer.Controls[0];
hf.Value = ViewState["Referrer"].ToString();
}
catch { }
}
Seems a little hacky... would you have any other thoughts?
Maybe a nice to have extension to contour... could be having the default value of a hidden field call a method from an assembly? that wasy you get the resultant call also logged as a record item for the backend to view.
send email workflow.. anyway to get the referring page to the form page?
So a little more explaination we have a link on a product page to email the sales engineer...
so if a user then ends up at the contour form and sends an email, we'd like to say they came from this product page...
as the workflow is outside of the page context.. any ideas on how we can retrieve the referer?
in a standard form scenario... we'd be using
and then reference the viewstate later.
Comment author was deleted
Hi Mike are you customizing the code, I think the record holds the id of the page it was posted on so you should be able to use that :)
Yep custom code for workflow and updated renderform.ascx and renderform.cs (for new fieldtypes - which just discovered need to be replicated somehow on the mvc side for preview to work as get errors of no fieldtype specified)...
The partial view '/umbraco/plugins/umbracoContour/Views/Fieldtype.textfieldwithcompare.cshtml' was not found or no view engine supports the searched locations. The following locations were searched: /umbraco/plugins/umbracoContour/Views/Fieldtype.textfieldwithcompare.cshtml
Can I make a request for new documentation as the 1.1 pdf is a little behind??? and maybe also for you to release the source code for renderform.cs??? Also did the customisable templates from v5 (where you put cshtml files in the app_data/plugins/countour/guid/renderform.cshtml) make it back into v3 and is that just a mvc thing or maybe webform support too?
And yep already use the record id, but that just gives me the page that the form is on... not the page that the user was on immediately before the form... eg the refering page to the form page...
Only way I can see is to perhaps have a hidden field, and set the value on page load for the referer, then I can access that hidden field via the record in the workflow?
Was just asking though if any way to get the System.Web.Page context from the custom workflow class??
Comment author was deleted
Sorry misunderstood the question have you tried if System.Web.HttpContext.Current.Request.UrlReferrer contains anything?
Ended up adding a hidden field and overriding the OnLoad or renderForm
Seems a little hacky... would you have any other thoughts?
Maybe a nice to have extension to contour... could be having the default value of a hidden field call a method from an assembly? that wasy you get the resultant call also logged as a record item for the backend to view.
Comment author was deleted
Glad you found a solution! Yup plan is to make it possible to extend the bracket syntax so it's possible to plugin custom stuff
http://issues.umbraco.org/issue/CON-54
is working on a reply...