The attached patch adds:
* Selection for single opt-in/out, double opt-in/out, without opt-in/out
* Selection for subscription at user registration: opt-in, forced, no registration.
Subscribers who opt-in during registration are subscribed after first login.

This patch deprecates the Simplenews on register module.

New for developers:
Helper function to translate a newsletter name if required
_simplenews_tt_newsletter_name($newsletter, $langcode = NULL)

Get array of newsletters with names translated.
simplenews_get_newsletters($vid, $show_all = FALSE)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moonray’s picture

I've read through the patch, and it's looking very nice (I didn't actually test it yet). I found a few things that Simplenews on Register has that this patch could possibly use (all comments are about the registration part):

- Customizable weight of the fieldset (in case a person is using profile fields or other custom modules that add non-standard fields; this exists in simplenews_register)
- There was a request to add a CSS class to the fieldset, which would be a simple tweak, and useful for themers. See http://drupal.org/node/404686
- The patch on http://drupal.org/node/611136 looks like an interesting addition.

Just some thoughts.

Sutharsan’s picture

Title: Enable single opt-in/out and subscription at user registration » Add single opt-in/out, hidden newsletters and the option to subscribe at registration
Sutharsan’s picture

Status: Needs review » Fixed

I've seen the weight, but I don't like options of this kind. It is a work-around of the difficulty of theming forms.
The options in issue #611136 are work-arounds for what has been fixed in my patch. The new user is subscibed /after/ account confirmation or first login.

Committed to HEAD. 6.x-2.x to follow shortly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Elijah Lynn’s picture

Status: Closed (fixed) » Active

I just installed the latest HEAD and I made a newsletter and set the "Opt-in/out method:" to "Hidden", set the permissions to allow authenticated users to subscribe to newsletters. The newsletter subscription box still appears on the "my subscriptions/my newsletter" page and if I uncheck the subscription box then save, it rechecks the box. I can get it to go away if I take away permissions for the "authenticated" user. BUt then that would mean authenticated users for all newsletters would not be able to (un)subscribe. We do have simplenews_roles-6.x-0.1 installed.

Is this the desired behavior for this patch?

darktygur-1’s picture

Status: Active » Needs review
FileSize
981 bytes

The problem is that when finding out which newsletters to hide, it looks for 'none' rather than 'hidden' in the simplenews_opt_inout option for each newsletter. Here is a patch that fixes that.

Sutharsan’s picture

Status: Needs review » Fixed

darktygur, thanks for the patch, but #683724: Hidden newsletters are visible already had one. Is now committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.