Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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)
Comment | File | Size | Author |
---|---|---|---|
#6 | simplenews-658242.patch | 981 bytes | darktygur-1 |
simplenews.opt_inout.patch | 24.39 KB | Sutharsan | |
Comments
Comment #1
moonray CreditAttribution: moonray commentedI'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.
Comment #2
Sutharsan CreditAttribution: Sutharsan commentedComment #3
Sutharsan CreditAttribution: Sutharsan commentedI'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.
Comment #5
Elijah LynnI 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?
Comment #6
darktygur-1 CreditAttribution: darktygur-1 commentedThe 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.
Comment #7
Sutharsan CreditAttribution: Sutharsan commenteddarktygur, thanks for the patch, but #683724: Hidden newsletters are visible already had one. Is now committed.