This module has to be converted to Drupal 6. I have attached my working version for this. Please check if this can be useful.
It has the added feature of removing footers for lists that are role-based. An unsubscribe link is pointless here.

Comments

sutharsan’s picture

attachment is missing

Jorrit’s picture

StatusFileSize
new5.07 KB

I'm sorry for that

JuLearn’s picture

Thanks a lot to Jorrit!
Trying to activate, I get the message
"This version is incompatible with the 6.5 version of Drupal core"
Any hints?

Jorrit’s picture

You have to edit the info file as well, add something like core = 6.x. I don't know exactly anymore, look in other info files.

JuLearn’s picture

Yes, I edited simplenews_roles.info. But not enough. With a reduction to

name = Simplenews Roles
description = "Automatically subscribe users in designated roles to a newsletter list."
package = Mail

project = "simplenews_roles"
core ="6.x"

it is running now. I am going to test it.

Babalu’s picture

subscribing

zilla’s picture

is this converted version working? possible to move to project page for more testing?

trophaeum’s picture

subscribing

kwgossett’s picture

subscribing

rhache’s picture

subscribing

kenorb’s picture

+1

tobiass’s picture

subscribing

sgdev’s picture

I attempted to use your module. If I sign on as a user, go to the user's User Profile > My Newsletters, and attempt to unsubscribe from the newsletter, I get the following error messages:

    * warning: array_keys() [function.array-keys]: The first argument should be an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 107.
    * warning: array_merge() [function.array-merge]: Argument #1 is not an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 109.
    * warning: array_unique() [function.array-unique]: The argument should be an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 109.
    * warning: array_intersect() [function.array-intersect]: Argument #2 is not an array in /htdocs/sites/all/modules/simplenews_roles/simplenews_roles.module on line 112.
Valeratal’s picture

subscribing

eff_shaped’s picture

subscribing

axel pressbutton’s picture

Also subscribing

encho’s picture

Subscribe

iaminawe’s picture

subscribe

KhaledBlah’s picture

@#13, ron_s:
This error occurs because there is no checking whether the "$edit" array actually has a "roles" array which it might have gotten from the form being used.

I have had another problem with the "simplews_newsletter_footer" theme function. Appearantly there already is such a function in simplenews and simplenews_roles tries to re-register the function. I have simply renamed the function "simplenews_roles_newsletter_footer" which got rid of my problem. However I have not tested yet whether this theme function is absolutely necessary.

Also, I have added a call to "simplenews_unsubscribe_user" for those users that don't have a matching role id for the current subscription. I know that this might be redundant because a sync is made before a newsletter is sent. However, this makes sure that when you manually remove a role from a user the subscription for this user will be deleted.

I have done two identical patch files, the one expects the filename to be "simplenews_roles.module.txt" (like uploaded above) while the other expects it to be "simplenews_roles.module" (like it might be in an installed module)

I have not done extensive testing yet so please be sure to use this at your own risk!

Feedback would be appreciated! I also plan on adding an opt-out feature so that once you opted out you won't get subscribed again even if you do have the specific role(s).

watersevenub’s picture

"Feedback would be appreciated! I also plan on adding an opt-out feature so that once you opted out you won't get subscribed again even if you do have the specific role(s)."

Right now, when a user opts out, what action will trigger his re-subscription? Ot the newsletter just gets sent to him anyway?

(Could you post an updated module with patches applied? Any ETA for the feature above mentioned? Thank you)

vacilando’s picture

Subscribing

joachim’s picture

Status: Active » Needs review

Changing status + subscribing.

joachim’s picture

StatusFileSize
new8.21 KB

Works for me.

Here is the complete module from #2 with the patch from #19 and my changes:

	static $role_newsletters;
	// let's cache this.
	if(!isset($role_newsletters)) {
		$role_newsletters = variable_get('simplenews_roles_tids_rids', array());
	}

There is no point in caching a variable_get. All variables are already cached by Drupal core.

No idea what is going on in simplenews_roles_nodeapi:
// Strip out non-Simplenews terms from taxonomy for posterity.

Added some missing function doc headers and made a few code style cleanups too :)

joachim’s picture

I've been given maintainership of this module, so I've gone ahead and committed the above (with a slight fix in my version of the info file -- I messed up the dependencies line!)

Thank you everybody for your hard work!

This should be available soon as a -dev version. Please test this further and report any bugs!

joachim’s picture

Status: Needs review » Fixed

BTW, @BSLFE: if you're still interested in working on an opt-out feature, see #331080: unsubscribe reverts back after cron run.

eff_shaped’s picture

@joachim - THANK YOU!

Jorrit’s picture

Thanks :) Also thanks for all the people who took the effort to publish their patches.

Status: Fixed » Closed (fixed)

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