Copied to clipboard

Flag this post as spam?

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


  • Dennis Flæng Jørgensen 35 posts 145 karma points c-trib
    Feb 04, 2016 @ 08:46
    Dennis Flæng Jørgensen
    0

    Contour Custom WorkFlowType not running on live

    Hey all,

    I have made this custom WorkFlowType for a customer and work as intended when i run it locally, but when i put it on the live server it wont execute.

    The way i published it was to make a new build and take the dll and put it on the FTP. I then created a new WorkFlowType of my custom type and added it to a existing form. I then tested the form in the contour backend. Since this didnt work (on live, it worked when i debugged locally), i tried added one of the default workflowtypes (Send Mail) and made sure it was placed after my custom workflowtype. The "Send Mail"-workflow was runned but mine wasnt and nothing was in the log (check the code for log outputs). I then tried moving the .cs-file of my custom workflowtype to the "App_Code"-directory on the live site, but this didnt chance anything.

    Any suggestions?

    Umbraco v6.1.6 (Assembly version: 1.0.5021.24867)

    Umbraco Contour version 3.0.18

    public class AttachStaticPdfToMailWorkType : WorkflowType
    {
        private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
    
        [Umbraco.Forms.Core.Attributes.Setting("Email", 
            description = "Enter the receiver email", 
            control = "Umbraco.Forms.Core.FieldSetting.TextField")]
        public string _Email { get; set; }
    
        [Umbraco.Forms.Core.Attributes.Setting("SenderEmail",
            description = "Enter the sender email (if blank it will use the settings from /config/umbracosettings.config)",
            control = "Umbraco.Forms.Core.FieldSetting.TextField")]
        public string _SenderEmail { get; set; }
    
        [Umbraco.Forms.Core.Attributes.Setting("Subject",
            description = "Enter the subject",
            control = "Umbraco.Forms.Core.FieldSetting.TextField")]
        public string _Subject { get; set; }
    
        [Umbraco.Forms.Core.Attributes.Setting("Message",
            description = "Enter the intro message",
            control = "Umbraco.Forms.Core.FieldSetting.TextArea")]
        public string _Message { get; set; }
    
    
        [Umbraco.Forms.Core.Attributes.Setting("Attachment file", description = "Attach a file to the e-mail", control = "Umbraco.Forms.Core.FieldSetting.File")]
        public string _AttachmentFile1 { get; set; }
    
        [Umbraco.Forms.Core.Attributes.Setting("Attachment file (2)", description = "Attach a file to the e-mail", control = "Umbraco.Forms.Core.FieldSetting.File")]
        public string _AttachmentFile2 { get; set; }
    
        public AttachStaticPdfToMailWorkType()
        {
            this.Name = "Send email (with attachments)";
            this.Id = new Guid("f8e45f17-6b05-4678-bcf3-6c031d62983e");
            this.Description = "Send the result of the form to an email address (with attachments)";
            Log.Info("AttachStaticPdfToMailWorkType - Init");
        }
    
        public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
        {
            try
            {
                Log.Info("AttachStaticPdfToMailWorkType - Start");
                (...)
                Log.Info("AttachStaticPdfToMailWorkType - Success");
                return WorkflowExecutionStatus.Completed;
            }
            catch (Exception ex)
            {
                Log.Error("AttachStaticPdfToMailWorkType - Failed", ex);
                return WorkflowExecutionStatus.Failed;
            }
        }
    
        public override List<Exception> ValidateSettings()
        {
            var result = new List<Exception>();
            if (String.IsNullOrWhiteSpace(_Email)) result.Add(new Exception("Email is empty"));
            if (String.IsNullOrWhiteSpace(_Subject)) result.Add(new Exception("Subject is empty"));
            if (String.IsNullOrWhiteSpace(_Message)) result.Add(new Exception("Message is empty"));
            return result;
        }
    }
    
  • Dennis Flæng Jørgensen 35 posts 145 karma points c-trib
    Feb 04, 2016 @ 09:38
    Dennis Flæng Jørgensen
    0

    Nvm - I solved it by putting the code in a seperate class library and added the needed reference:

    • log4net
    • System.Configuration
    • System.Web
    • Umbraco.Forms.Core

    I then build the dll and put it in my bin folder on the live site

Please Sign in or register to post replies

Write your reply to:

Draft