Copied to clipboard

Flag this post as spam?

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


  • Paul Fowles 75 posts 184 karma points
    Jun 06, 2012 @ 23:45
    Paul Fowles
    0

    Unsubcribe API methods not working?

    Hello Owen,

    I've discovered a bug using the campaign letter api (in both 0.42 and 0.43) with the unsubscribe methods. The query seems to want to find a column called 'UniqueID' in uwz_subscribeItem tableto do the unsubscription however, this column doesn't exist. The data the method requires is in the column 'SubscribeTypeUniqueID' which is needed if I want to use the subscribe methods of your api in a usercontrol.

     

    I've solved this issue in MSSQLExpress by adding a computed column (UniqueId=SubscribeTypeUniqueId) to the table but when I add a trigger in MySql it throws an error to do with MySql and breaks your 0.43 solution to the MySql issue I posted.

    I believe I know where the issue lies in 0.42 source code to change but don't have the 0.43 source code to change

    The query should be SubscribeTypeUniqueID = id , rather than UniqueId = id 

    Paul

  • Paul Fowles 75 posts 184 karma points
    Jun 06, 2012 @ 23:57
    Paul Fowles
    0

    In (0.42 beta) Services/library.cs

     public static bool UnSubscribe(String email, Guid subscribeType)
            {
                email = email.Trim();
                using (var session = SessionProvider.CreateSession().OpenSession())
                {
                    var result = session.CreateSQLQuery("DELETE uwz_SubscribeItem WHERE UniqueID = :id AND EmailAddress=:email")
                        .SetParameter("id", subscribeType.ToString())
                        .SetParameter("email", email)
                        .ExecuteUpdate();
                    return result > 0;
                }
            }
    where bold is the issue and should be something like this

    var result = session.CreateSQLQuery("DELETE FROM `uwz_SubscribeItem` WHERE SubscribeTypeUniqueID = :id AND EmailAddress=:email")

Please Sign in or register to post replies

Write your reply to:

Draft