Copied to clipboard

Flag this post as spam?

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

  • Alex Skennerton 17 posts 179 karma points notactivated
    Apr 12, 2024 @ 14:16
    Alex Skennerton

    Custom forms workflow with Newsletter Studio

    I am trying to create a custom workflow within Umbraco forms to allow users to sign up for a mailing list in Newsletter Studio.

    The form works and the workflow runs but no information is copied into the mailing list, what am I missing?

    using Umbraco.Forms.Core;
    using Umbraco.Forms.Core.Enums;
    using Umbraco.Forms.Core.Persistence.Dtos;
    using NewsletterStudio.Core.Public.Models;
    namespace MyFormsExtensions
        public class Subscribe : WorkflowType
        public Subscribe()
            Name = "Newsletter Sign-up";
            Id = new Guid("7793f98d-266f-4905-b2f2-9d27438da763");
            Description = "Add sign-ups to the mailing list";
            Icon = "icon-inbox";
        public override WorkflowExecutionStatus Execute(WorkflowExecutionContext context)
                RecordField? recordNewsletteremail = context.Record.GetRecordFieldByAlias("email");
                RecordField? recordName = context.Record.GetRecordFieldByAlias("name");
                RecordField? recordDistrict = context.Record.GetRecordFieldByAlias("district");
                var newsletteremail = recordNewsletteremail.ValuesAsString();
                var name = recordName.ValuesAsString();
                var district = recordDistrict.ValuesAsString();
            var request = AddRecipientRequest.Create(newsletteremail)
               .WithCustomField("District", district)
            return WorkflowExecutionStatus.Completed;
        public override List<Exception> ValidateSettings()
            return new List<Exception>();
  • Markus Johansson 1924 posts 5831 karma points MVP 2x c-trib
    Apr 12, 2024 @ 15:50
    Markus Johansson


    Nice integration!

    You need to pass the request that is built to the INewsletterStudioService.

    var result = _newsletterStudioService.AddRecipient(addRecipientRequest);

    There is a working example here

    Another thing to mention here is that it’s quite easy to add a workflow step to Umbraco Forms that will send a transactional email - quite cool for confirmations, notifications etc.


Please Sign in or register to post replies

Write your reply to: