Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Griffiths 791 posts 1189 karma points c-trib
    Jan 04, 2013 @ 18:25
    Martin Griffiths
    0

    Contour CodeFirst Workflow

    Hi Tim

    Is it possible to apply a workflow to a form CodeFirst?

    Martin

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 07, 2013 @ 09:49
    Tim Geyssens
    0

    Yup it is, will digg up some examples

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Jan 07, 2013 @ 09:51
    Tim Geyssens
    0

    You can create a workflow like this

        [Workflow("Send Email",FormState.Submitted)]
        public class Email: WorkflowBase
        {
    
            public override WorkflowType Type
            {
                get
                {
                    return new Umbraco.Forms.Core.Providers.WorkflowTypes.SendEmail
                        {
                            Email = "[email protected]",
                            Subject = "the form Contact Form was submitted",
                            Message = "the form Contact Form was submitted, " +
                                        "this is the list of values it contained, " +
                                        "you can turn this email off under workflows in Umbraco Contour"
                        };
                }
            }
        }

    Then on the form class override Workflows property

            public override List<WorkflowBase> Workflows
            {
                get
                {
                    return new List<WorkflowBase> {
                            new Email()
                        };
                }
            }

     

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies