Copied to clipboard

Flag this post as spam?

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


  • Karlo Medallo 14 posts 36 karma points
    Jun 05, 2014 @ 05:18
    Karlo Medallo
    0

    Unsubscribe via API seems to unsubscribe to all lists (1.4.4 - umb 6.1.6)

    Hi,

    I'm using the API to unsubscribe members and part of my code looks like this:

    var subscriptionAlias = String.Format("NewsletterStudioSubscriptionProvider_{0}", subscriptionId);
    NewsletterStudio.Api.UnSubscribe(email.ToLower(), subscriptionAlias);

    However, when I check the member, it seems that it gets unsubscribed from all lists. Can you confirm?

    I hope the source is not obfuscated because it just seem so hard to debug and there's always this something at the back of my mind that thinks that obfuscation causes code to behave differently :/

    Thanks,

    Karlo

     

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    Jun 10, 2014 @ 01:08
    Markus Johansson
    0

    Hi!

    Sorry for my lat anwser!

    The source is obfuscated but this works when unsubscribing from other parts of the app. I will have to create a bug report for this and try to reproduce it. Meanwhile you could open the subsciber manually by calling to the lower level API.  Use the SubsciberRepository to get the subscibers.

    int mailingListId = 2; // set to the nr you like
    var repo = new SubscriberRepository();
    var subscriber = repo.GetSubscribersByEmail("[email protected]").Where(x=>x.SubscriptionId = mailingListId);
    subsciber.Status = SubscriberStatus.Unsubscibed;
    repo.Save(subscriber); 

    I have not compiled this code but you get the concept =D

    I'll get back to you when we have tried to reproduce the bug.

     

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    Sep 08, 2014 @ 19:26
    Markus Johansson
    0

    Hi!

    This is a confirmed bug and there will be a fix in upcomming versions of the package. 

    / m 

  • keilo 568 posts 1023 karma points
    Sep 09, 2014 @ 19:50
    keilo
    0

    Hi Markus

    Is there an estimate date for the upcoming update to NS?

    I can replicate this particular issue too which is a show stopper indeed.. You have mentioned before there will be a new Event model in the upcoming version, so was wondering what would be the features/list that we should expect from the upcoming version?

    cheers

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    Sep 11, 2014 @ 09:07
    Markus Johansson
    0

    Hi!

    Yes it was a logic error in the data layer and the bug is present in both the V4-6-version and the V7-version. The fix will be included in the next release probably in 2-3 weeks.

    There will be a simple event-model included in the V4-6-version and a more rubust one in the V7-version but I can't give you the exact list of events. Is there any special event that you really need?

    // m 

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    Sep 14, 2014 @ 21:41
    Markus Johansson
    0

    Hi!

    There is a new release our now that can be downloaded from http://www.newsletterstudio.org

    Please let me know if you have any other issues.

    // m 

  • keilo 568 posts 1023 karma points
    Sep 17, 2014 @ 17:03
    keilo
    0

    Hi Markus

    Im particularly interested in a event where i can get the full mime before it goes to SMTP, so i can route it through spam score checker and return value to user.

    Would be great if there are more examples on how to use the event, custom providers and specifically how to better handle unsubscribe for custom providers.

    Followed the link to the website but the version for 7 shows the same 2.00 as per the project page. Assuming there is no update for 7 yet..

    Looking forward to the next update!

  • keilo 568 posts 1023 karma points
    Sep 17, 2014 @ 17:48
    keilo
    0

    Almost forgot the other event I was trying to get to work.

    When creating newsletter programmatically, via razor, i successfully created and used the 'hacky' way (which was using webclient to hit the page) to send it immediately.

    However if just schedule it, the schedule didnt execute on the arranged date/time. Would be great if the scheduling for programmatically created newsletters are handled seamlessly - not sure if it falls under the events context but that would be great! In most use cases using already created content within CMS and filtering it with Razor, attaching it to pre-defined template and scheduling it to be send-out (as per user input captured in document property) would be great!

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    Sep 19, 2014 @ 20:05
    Markus Johansson
    0

    Hi!

    This is the events that will be included: http://support.newsletterstudio.org/customer/portal/articles/1690043-events and you will be able to use the NewsletterStudio.Services.SendNewsletterService.SendningInitializing-event to runt the spam-checker.

    The events was released 4 days ago we have not had the time to update the docs but it will come =D

    The unsubscibe is no problem - you just need to implement the unsubscibe-method in the provider. 

    Thats right, the API-fixes is still in the backlog and will be included in upcomming releases. If the scheduled send out did not start it sounds to me like there is something wrong with your scheduled tasks?

    / m 

  • keilo 568 posts 1023 karma points
    Dec 03, 2014 @ 08:27
    keilo
    0

    Hi Markus

    Is there any update on the new event documentation, i have looked through the site but cant seem to find any. Would be great if you can share some prelim examples.

     

    For the scheduled sending programmatically, I was referring to the article at 

    http://support.newsletterstudio.org/customer/portal/questions/1505511-working-with-newsletter-studio-programmatically

    where using the same code with Date.Time.Now works, as the webclient hits the page at the time of executing the code.

    But using the same code, and setting a future date to be send, email is not dispatched on the date/time of the scheduled - perhaps the code example is not applicable for future date sending programmatically?

    cheers

     

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    Dec 03, 2014 @ 20:48
    Markus Johansson
    0

    Hi!

    The link to the documentation about events is still the most recent one - all events are documented but there is no code samples at the moment. We will try to add this to our sample project on github. I'll keep you posted about this.

    About scheduled emails via code.

    This example is still the one that works best. Just change the date/time and remove the call to the service and change the date and the automatic scheduled task in umbraco should fire the send out.

    This it the code you should remove
    // Start the sending by calling the scheduled task.
    string url = Helper.RequestSchemeHostAndPort + "umbraco/newsletterstudio/pages/NewsletterCheckForScheduledSendOut.aspx";
    string response = Helper.DownloadWebPage(url); 

    Cheers!

  • keilo 568 posts 1023 karma points
    May 18, 2015 @ 08:59
    keilo
    0

    I came back in another attempt to get the NewsletterStudio running on a test environment.

    The routine posted by OP still unsubscribers users from all the lists (using the latest NS on v7.1).

    If I try the example code (with typo fixed) given in the reply, i cant get it to work - not sure if hitting the correct method;

    var repo = new NewsletterStudio.Infrastucture.Data.SubscriberRepository();

    var subscriber = repo.GetSubscribersByEmail(email).Where(x=>x.SubscriptionId == mailingListId);

    subscriber.First().Status = NewsletterStudio.Core.Model.SubscriberStatus.Unsubscribed;

    repo.Save(subscriber); 

    ----

    The above would give error "The best overloaded method match for 'NewsletterStudio.Infrastucture.Data.SubscriberRepository.Save(NewsletterStudio.Core.Model.Subscriber)' has some invalid arguments" on the repo.Save(..)

    Is there any working routine to get an email unsubscribed from the given list, not all the lists?

    would appreciate your feedback and input.

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    May 18, 2015 @ 09:54
    Markus Johansson
    0

    Hi!

    The argument that you are passing to the save-method is a collection of subscribers - you will have to pass the subscriber it self. Something like this:


     var subscriber = repo.GetSubscribersByEmail(email).Where(x=>x.SubscriptionId == mailingListId).First();

    subscriber.Status = NewsletterStudio.Core.Model.SubscriberStatus.Unsubscribed;

    repo.Save(subscriber); 

  • keilo 568 posts 1023 karma points
    May 18, 2015 @ 10:40
    keilo
    0

    Thanks for the heads up. Is there an easy way to list/iterate all the Mailing Lists with razor?

    For a consolidated page where user can subscribe to one or more of the mailing list this will come in handy. Not sure how to go about it..

    any pointers?

  • keilo 568 posts 1023 karma points
    May 18, 2015 @ 11:38
    keilo
    0

    Ok, figured out one way of getting the list, including here for reference for others with same requirement;

    var listrepo = new NewsletterStudio.Infrastucture.Data.MailingListRepository();

    foreach (var thelist in listrepo.GetAll()){

           <p>@thelist.Name.ToString()</p>

     }

  • keilo 568 posts 1023 karma points
    May 18, 2015 @ 12:21
    keilo
    0

    Is there a method to get the Mailing List Names by email address? Need to provide a page where user can see existing subscriptions and edit them - i can parse the editing part but for listing by email is there an existing method?

  • Markus Johansson 1913 posts 5760 karma points MVP c-trib
    May 18, 2015 @ 14:02
    Markus Johansson
    0

    Hi!

    No there is no method for this at the moment - you will have to check the status of that subscriber for each mailing list.

    This design of the database has been around since v1 of Newsletter Studio and we know that the solution could have been smoother with a relation-table that connects a subsciber with different mailing lists instead of this solution where each mailing list has its own "version" of the subscriber.

    It's in the backlog of the project but I cant say if and when we will introduce this - as its a major change that will require updated to the db we might wait until the next major release of the package.

    / M 

Please Sign in or register to post replies

Write your reply to:

Draft