Copied to clipboard

Flag this post as spam?

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


  • Tim 174 posts 398 karma points
    Jan 29, 2018 @ 05:48
    Tim
    0

    Name not updated on Subscribe

    We've got a page which allows the customer to update their subscription(s) which calls NewsletterStudio.Api.Subscribe however it doesn't seem to update the subscriber's name.

    Looking at the code it looks as though it only updates the status of the subscriber:

    Subscriber subscriber = subscriberRepository.GetSubscribersByEmail(email).First<Subscriber>((Func<Subscriber, bool>) (x => x.SubscriptionId == mailingListId));
    subscriber.Status = new int?(1);
    return subscriberRepository.Save(subscriber) > 0;
    

    Could you change it so it also updates the name so we don't have to do two calls please.

    Thanks.

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Jan 29, 2018 @ 09:38
    Markus Johansson
    0

    Hi!

    Thanks, I guess that you mean that if you provide an email that already exsists the name would not be updates?

    I've added this as a fix for upcoming release.

  • Tim 174 posts 398 karma points
    Jan 29, 2018 @ 09:53
    Tim
    0

    Correct, I'd make the name optional though so something like this:

    if(!string.IsNullOrWhiteSpace(name))
        subscriber.Name = name
    

    So at least you then have the option of not providing a name (although looking elsewhere in your codebase, you're always assigning a name -using the start of the email?).

    Tim

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Feb 16, 2018 @ 16:15
    Markus Johansson
    0

    Hi!

    This is included in the new release 2.1.9.2.

    https://www.newsletterstudio.org/download/

    // m

Please Sign in or register to post replies

Write your reply to:

Draft