Copied to clipboard

Flag this post as spam?

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


  • Severin 7 posts 98 karma points
    Jun 22, 2016 @ 09:14
    Severin
    0

    Scheduled send out not working

    Hi

    We are using Newsletter Studio for a big customer who sends up to 40'000 newsletter per month. There are also many scheduled send outs, mostly at night or the weekend.

    Strange thing is that sometimes the scheduled send out works and sometimes an error occurs.

    The Log looks like this:

    2016-06-20 19:08:37,321 [P7068/D2/T41] INFO umbraco.BusinessLogic.Log - Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: ScheduledTask | User: 0 | NodeId: 0 | Comment: NewsletterStudio: ScheduledTask. Started thread to send newsletter "1606PWFsm" (id 394) 2016-06-20 19:08:37,336 [P7068/D2/T30] INFO Umbraco.Web.Scheduling.ScheduledTasks - newsletterstudioSendout has been called with response: True 2016-06-20 19:08:37,352 [P7068/D2/T51] INFO umbraco.BusinessLogic.Log - Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Error | User: 0 | NodeId: 0 | Comment: NewsletterStudio: Cound not load subscription-providers. Please check configuration. 2016-06-20 19:08:37,352 [P7068/D2/T35] INFO umbraco.BusinessLogic.Log - Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Error | User: 0 | NodeId: 0 | Comment: NewsletterStudio, SendNewsletterService: Sequence contains no matching element : at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate) at NewsletterStudio.Bll.Providers.SubscriptionProviderFactory.GetProviderByName(String uniqName) at NewsletterStudio.Bll.Providers.SubscriptionProviderFactory.GetReceiversBySubscriptionAlias(String value, SendOutParams parameters) at NewsletterStudio.Services.EmailTrackingItemService.CreateTrackingItems() at NewsletterStudio.Services.SendNewsletterService.SendEmails()

    I have written a custom SubscriptionProvider and also added it as the only SubscriptionProvider to the newsletterStudio.config file.

    Do you have any idea, what the problem might be?

    Additional Information:

    Umbraco v7.3.4

    Newsletter Studio v2.1.4

  • Markus Johansson 1914 posts 5761 karma points MVP c-trib
    Jun 23, 2016 @ 11:33
    Markus Johansson
    0

    Hi!

    Thanks for using the package!

    I can't really say why this error happens, might be something with you custom class that throws an error.

    This error "NewsletterStudio: Cound not load subscription-providers. Please check configuration." Indicated that something goes wrong when Newsletter Studio loads all the subscription providers - maybe something with the construtor of your class?

    The provider is running in a new thread so maybe that's the problem?

    You could wrapp you own code with try/catch statements to log any errors in you code - that would give you better insights.

    Cheers!

    // m

  • Severin 7 posts 98 karma points
    Jun 29, 2017 @ 11:27
    Severin
    0

    Hi!

    Had this error again and with the improved logging of the newer NewsletterStudio version i now see that the error is in the constructor of the UmbracoNewSubscriptionProvider from which i extend my custom subscription Provider.

    2017-06-26 12:01:45,143 [P10248/D2/T28] INFO umbraco.BusinessLogic.Log - Redirected log call (please use Umbraco.Core.Logging.LogHelper instead of umbraco.BusinessLogic.Log) | Type: Error | User: 0 | NodeId: 0 | Comment: NewsletterStudio: Cound not load subscription-provider: MerbagSubscriptionProvider, type: Opten.MerbagRetail.Web.Providers.MerbagSubscriptionProvider, Opten.MerbagRetail.Web. Are you sure that the type exsists? Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.

    at NewsletterStudio.Bll.Providers.UmbracoNewSubscriptionProvider..ctor()

    at Opten.MerbagRetail.Web.Providers.MerbagSubscriptionProvider..ctor()

    --- End of inner exception stack trace ---

    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)

    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

    at System.Activator.CreateInstance(Type type, Boolean nonPublic)

    at System.Activator.CreateInstance(Type type)

    at NewsletterStudio.Bll.Providers.SubscriptionProviderFactory.GetProviders()

    Are you doing something with the UmbracoContext in the constructor? I know from previous Projects that the UmbracoContext is not initialized in a new thread.

    Hope this helps finding the concrete Problem.

    Cheers!

  • Markus Johansson 1914 posts 5761 karma points MVP c-trib
    Jun 30, 2017 @ 13:27
    Markus Johansson
    0

    Hi!

    We are using the UmbracoContext in the provider to be able to call the member service but we have not seen any issues with this before?

    I can't share the exact details about the constructor but I would not recommend to use the UmbracoNewSubscriptionProvider as base-class for your subscription provider, use the SubscriptionProviderBase as the documentations recommends: http://support.newsletterstudio.org/customer/en/portal/articles/1052901-subscription-providers.

    There is also examples of how to implement the providers here: https://github.com/enkelmedia/NewsletterStudioContrib/tree/master/Newsletter%20Studio%20V2/NewsletterStudioContrib/SubscriptionProviders

    Let me know if this solves your issues.

    // m

Please Sign in or register to post replies

Write your reply to:

Draft