Copied to clipboard

Flag this post as spam?

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


  • Kalle Wibeck 30 posts 81 karma points
    Oct 14, 2012 @ 22:57
    Kalle Wibeck
    0

    Can't send to Umbraco Member group (Specified cast is not valid)

    Hi,

    When I tries to send a newsletter to a Umbraco Member Group I receive an error in the "Send newsletter" modal dialog.

    The sam happens with a scheduled send-out?

    Does anyone have any suggestion for where to start looking for the reason for this?

    // Kalle

    Thi is written to the lg during a scheduled send-out:

    At /umbraco/newsletterstudio/pages/NewsletterCheckForScheduledSendOut.aspx (Referred by: ): System.InvalidCastException: Specified cast is not valid.     at NewsletterStudio.Bll.Providers.UmbracoSubscriptionProvider.GetSubscribersForSendOut(String listItemValue, SendOutParams parameters)     at NewsletterStudio.Model.Newsletter.ValidForSending(List`1& errs)     at NewsletterStudio.Pages.NewsletterCheckForScheduledSendOut.Page_Load(Object sender, EventArgs e)     at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)     at System.EventHandler.Invoke(Object sender, EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Oct 15, 2012 @ 06:32
    Markus Johansson
    0

    Hi Kalle!

    If this error shows when you are trying to send manually chances are big that it happens when performing a scheduled send out as well.

    1. Are you using any custom providers or render tasks?
    2. Have you tried with different member groups?
    3. Are you using any custom properties on the members?



  • Kalle Wibeck 30 posts 81 karma points
    Oct 15, 2012 @ 07:11
    Kalle Wibeck
    0

    Hi Markus and thanks for your reply!

    1. No, I'm not using any custom providers/tasks.
    2. Yes, a small group with only 10 members worked fine, but not this one with 1100+ members.
    3. No custom properties on them, but a bunch of generic ones of course.
    I've filtered my members and removed some without or with an invalid mailadress.
    But that made only one difference, the preparation ran for a longer period of time before that error was displayed...?
    I just wanna find out what member/address that causes this error, it's hard to guess when no hints are displayed...
    Any suggestions are welcome...   // Kalle
  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Oct 15, 2012 @ 07:22
    Markus Johansson
    0

    Hi!

    Are you using the "newsletter"-property? This value is checked for nulls and then converted to an int (umbraco uses ints for bools) and checked before adding this user to the send out list.

    I think that this could be the problem, if the newsletter property contains something else than null or an int the cast will probably fail.

  • Kalle Wibeck 30 posts 81 karma points
    Oct 15, 2012 @ 08:23
    Kalle Wibeck
    0

    Hi Markus!

     

    You where absolutely correct, it must have been the "newsletter" property.

     

    A week ago I exported all these members and manually set this property to 1 and then imported them again.

    But since then our users added 4 more members where this property wasn't set at all or set to an umbraco default value.

    Strangely it doesn't seem like you handle the null values, cause once I set these 4 members to newsletter=1 the process ran on without any error messages for all of my 1184 members... ; )

    // Kalle

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Oct 15, 2012 @ 08:49
    Markus Johansson
    0

    Hi!

    The null values are handled but it could be the case that the value is String.Empty and that is not handled at the moment. Seams like a small bugg in the provider that we will have to fix in the next version.

    If  you really need this to be fixed asap I could share the code for the provider so that you can fix this errors and use it as a customer subscription provider. Send me an email on markus [at sign goes here] enkelmedia.se

    // markus

  • Kalle Wibeck 30 posts 81 karma points
    Oct 15, 2012 @ 08:54
    Kalle Wibeck
    0

    OK, I see...

    Thanks for your suggestion Markus,

    But I think that I'll try to handle the default values via the creation process instead since all these members are created programatically anyway...

    // Kalle

  • Kalle Wibeck 30 posts 81 karma points
    Oct 15, 2012 @ 10:30
    Kalle Wibeck
    0

    BTW, are/will these null / String.Empty  values being handled as subscribed or as unsubscribed?

    From my - "opt-out" - point of view a null/empty value should be treated as "subscribed" when sending out newsletters.

    That member haven't yet said yes or no so it makes sense to send an email with the option to unsubscribe...

     

    // Kalle

  • Kalle Wibeck 30 posts 81 karma points
    Oct 15, 2012 @ 10:37
    Kalle Wibeck
    0
  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Oct 15, 2012 @ 11:10
    Markus Johansson
    0

    Hi!

    If using the newsletter-property on a member the value has to be set to true (1) for it to be treated as valid. If you need to send to users that haven't had the option to choose - just set "true" as the default value for new members.

    (But in Sweden your not allowed to send emails to private persons who have not explicity said yes to it)

Please Sign in or register to post replies

Write your reply to:

Draft