Get answers quicker by searching

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Unsubscribe clarification
  • Vote Up0Vote Down vsmvsm
    Posts: 13Sendy user

    Hi Ben,

    Continuing from this post http://forum.sendy.co/discussion/852/unsubscribe-mechanism/p1

    Do this:
    1. Create a "List 1", then add "hello@sendy.co" as a recipient.
    2. Create a "List 2", then add "hello@sendy.co" as a recipient.
    3. Create New Campaign and release the campaign with some test data - be sure to include Unsubscribe here
    4. When you receive the email, click on the unsubscribe link.
    5. Check your lists above - "hello@sendy.co" would be unsubscribed from "List 1" and "List 2" - this is expected behavior, which is good.
    6. Create a "List 3", then add "hello@sendy.co" as a recipient - interestingly, the mail gets added even after the the user has clearly unsubscribed.

    Is this how you intended it to function, or is this a bug? I feel that this is a bug because a Brand will have multiple lists but once the user unsubscribes he/she should be permanently unsubscribed. Please can you clarify?

    Thanks

  • 6 Comments
  • Vote Up0Vote Down BenBen
    Posts: 3,489Sendy support

    Hi @vsm,

    It's not a bug. If your Unsubscribe settings is set as "All lists", the recipient will be unsubscribed from all lists when they click unsubscribe. But when they decide to subscribe to any list again, they will be subscribed to the list of their choice.

    Unless a recipient is marked as "bounced". They will never be added to any lists again if you add the email again to any list in future.

    Thanks.

    Best regards,
    Ben

  • Vote Up0Vote Down vsmvsm
    Posts: 13Sendy user

    Hi Ben,

    Thanks for replying. So in order to get it working how I want, we can do the following:
    1) Run a query to get ALL unsubscribes for a brand:

    SET @brand_id=1;
    SELECT 
        DISTINCT(s.email)
    FROM 
        lists AS l,
        apps AS a,
        subscribers AS s
    WHERE
        a.id=l.app
        AND l.app=@brand_id
        AND l.id=s.list
        AND unsubscribed=1    
    

    2) Create a new list and import users (which may have users that have previously unsubscribed):
    3) Mass Unsubscribe the users by importing the spreadsheet generated in step 1

    These steps must be run prior to each list creation. Do you agree or is there a better way to do this?

    Thanks

  • Vote Up0Vote Down BenBen
    Posts: 3,489Sendy support

    Hi @vsm,

    There's an easier way to do it. But you need to edit Sendy's code.

    Assuming you're importing CSVs via a cron job, open import-csv.php and replace line 183 with the following:

    $q = 'SELECT email from subscribers WHERE (email = "'.$linearray[0].'" || email = " '.$linearray[1].'" || email = "'.$linearray[1].'") AND bounced = 1 AND unsubscribed = 1';

    Best regards,
    Ben

  • Vote Up0Vote Down BenBen
    Posts: 3,489Sendy support

    The above code not only take into account not importing previously bounced subscribers, but previously "unsubscribed" subscribers as well.

  • Vote Up0Vote Down vsmvsm
    Posts: 13Sendy user

    Thanks a stack Ben. I think you meant to say OR instead of AND...

    So in import-csv.php:
    $q = 'SELECT email from subscribers WHERE (email = "'.$linearray[0].'" || email = " '.$linearray[1].'" || email = "'.$linearray[1].'") AND bounced = 1 OR unsubscribed = 1';

    And in /includes/subscribers/line-update.php:
    $q = 'SELECT email FROM subscribers WHERE (email = "'.$email.'" || email = " '.$email.'" || email = "'.$email.'") AND bounced = 1 OR unsubscribed = 1';

  • Vote Up0Vote Down BenBen
    Posts: 3,489Sendy support

    Oh yes, I meant to say OR instead of AND.

This discussion has been closed.
All Discussions