/ExampleThankYouPage.cshtml Secret
Last active
April 27, 2021 20:27
Star
You must be signed in to star a gist
Umbraco 8: Example of Thank you page after "Save As Member" workflow runs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<IPublishedContent> | |
@{ | |
var result = Umbraco8FormsMembersHelper.GetWorkflowResult(); | |
if (result != null) | |
{ | |
if (result.WorkflowResult == WorkflowExecutionStatus.Failed) | |
{ | |
//Failure - Show some messages | |
<h3>Oops! There was a problem registering you with that information.</h3> | |
if (result.Errors.ContainsKey(Umbraco8FormsMembersHelper.SaveError.InvalidPassword)) | |
{ | |
<p>That password doesn't meet security requirements</p> | |
} | |
if (result.Errors.ContainsKey(Umbraco8FormsMembersHelper.SaveError.EmailAlreadyRegistered)) | |
{ | |
<p>That email address is already registered. Would you like to <a href="/Login">Login</a>?</p> | |
} | |
foreach (var error in @result.Errors) | |
{ | |
<!--@error.Key = @error.Value--> | |
} | |
<input action="action" type="button" value="Try Registering Again" onclick="window.history.go(-1); return false;" /> | |
} | |
else | |
{ | |
//Success | |
//Optional - run other post-registration code | |
var updatedMember = UpdateNewMember(result.NewMemberId); | |
if (updatedMember != null) | |
{ | |
<h3>Thanks for Registering, @updatedMember.FirstName!</h3> | |
} | |
else | |
{ | |
<h3>Thanks for Registering!</h3> | |
} | |
} | |
} | |
else | |
{ | |
<p>Hmm... something didn't work.</p> | |
} | |
@Html.Partial("MemberLogout", Model) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment