We have an issue where emails go out to contacts in this group, they unsubscribe from the group via the email (sent through civimail) - successfully - and then the next time they log in again, they are added back into the group.

Is there any support for precedence of a "Removed (by Email)" status over a subsequent "Added (by API)" the next time the user logs in? Or is it possible to have this module join a user's contact to a group only on the first sign in or something (on a one-time basis)?

Comments

EvanDonovan’s picture

Version: 5.x-1.2 » 6.x-1.x-dev
Category: support » bug

I think that the module would have to run a query on a CiviCRM table to see whether the user opt-out flag is set, and, if it is set, not add them. Possibly there is an API function CiviCRM exposes to do this.

This bug will have to wait until after 6.x-1.0-beta (basic compatibility), and then get backported into 5.x-2.1 (after 5.x-2.0 (CiviCRM 2.0 compatibility) is made).

EvanDonovan’s picture

Title: auto-rejoins an unsubscribed contact the next time they sign in » auto-rejoins an unsubscribed contact who unsubscribed via email the next time they sign in

I realized that the unsubcribe for a given group will need to be checked as well as the opt-out.

EvanDonovan’s picture

Since the module adds to group on hook_user $op == 'login', it should be possible to check the global opt-out and group-specific unsubscribe values for the given contact, and make the adding to the group conditional upon that.

Alternatively, there might be a way to have it only add the user on first login, not every login.

A patch is welcome for this - I might not get around to it for a while since I don't use this module myself currently.