I am using the Simplenews Roles module on d5. Yes, I know that this module is no longer supported but it's worked perfectly for me. I use it to automatically subscribe users that purchase a certain item.
I am now wanting to setup a basic Mailing List in addition to my subscriptions. If you are familiar with Simplenews Roles, you know that as cron runs it checks the roles of each user and subscribes them or unsubscribes them to certain newsletters based on those roles. Well, this is where the problem comes in. The mailing list is for anonymous users, as you can imagine, each time cron runs it clears the anonymous users from the list.
The module is only 100 lines of code and I think this is the part that needs edited. I want to hard code it so that it just excludes the newsletter. The $tid of the newsletter is "349". Here is the portion of code that I think handles finding the newsletters that need checked.
function simplenews_roles_cron() {
foreach(variable_get('simplenews_roles_tids_rids', array()) as $tid => $rids) {
simplenews_roles_update_subscriptions($tid, $rids);
}
}
My thinking was to just remove 349 from the array. Think this would work?
To give more background, here is the code that follows right after the above portion:
function simplenews_roles_form_alter($form_id, &$form) {
if ($form_id == 'simplenews_admin_types_form' && !empty($form['tid']['#value'])) {
$form['#submit']['simplenews_roles_newsletter_submit'] = array();
$role_newsletters = variable_get('simplenews_roles_tids_rids', array());
$form['roles'] = array(
'#type' => 'checkboxes',
'#title' => t('Automatically subscribe users in the following roles to this newsletter'),
'#options' => user_roles(TRUE),
'#default_value' => isset($role_newsletters[$form['tid']['#value']]) ? $role_newsletters[$form['tid']['#value']] : '',
'#description' => t('This newsletter subscription list will consist of only users in the selected roles. This newsletter subscription is automatically syncronized so any users manually added to this list will be removed if they are not in any of the selected roles.'),
'#weight' => 10,
);
}
}
Comments
Any ideas? There have been a
Any ideas? There have been a couple responses here: http://drupal.org/node/558588
I would appreciate any help you can offer! Thanks.