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 826 posts 1269 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

  • Comment author was deleted

    Jan 07, 2013 @ 09:49

    Yup it is, will digg up some examples

  • Comment author was deleted

    Jan 07, 2013 @ 09:51

    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()
                        };
                }
            }

     

     

Please Sign in or register to post replies

Write your reply to:

Draft