I'm not looking for newsletter functionality, I just need to send my members (15K+) server notices every now and then...how could this feature be overlooked?

Comments

Michael M’s picture

Well, the problem is that the website will be running slowly while those emails are sent.

But, this is an easy task. It just requires a little PHP.

----
http://PointHomes.com

xamox’s picture

If you read below you will see this turns into a big flamewar.

If you want the functionality he is talking about then just grab the Advanced User module.
http://drupal.org/project/advuser

---------------------------------------------------------------
http://xamox.NET

underpressure’s picture

what flame war? Do you mean the conversation between me and Steven Peck? If that is what you are talkign about, then that was simply two guys disagreeing and nothing more.
--------------------->
underpressure
http://ravalonline.com

Muslim guy’s picture

Xamox, thanks for the info .. btw how to use ADVUSER. I think it is only to EMAIL certain roles when a new user registers, not email certain roles a fresh content like MAIL does

I see this: it has only two functions? Mail notifications on new users / Profile module special settings
and below is the settings/options

advuser
Mail notifications on new users
User notify
Notify selected roles when new users register.
Mail subject:
The subject of the mail that is going to be sent to the user. Placeholder variables: %username, %site.
Mail body:
The mail that is going to be sent to the selected roles. Placeholder variables: %username, %site, %uri.
Roles:
authenticated user
Roles that receive email notifications when new applicants register.

Profile module special settings
Profile fields:
Profile fields to be used as filters for the users.

NoahY’s picture

Hi,

I just created a mass mailer for Drupal 5.0 and thought it might be worth having others check it out for bugs, etc. All it took was a little php, as mentioned. I took the core contact module, copied it over to mass_contact, then hacked it apart to turn it on its heels (brutal, I know) and send mail from the admin to registered users based on their roles (or to everyone). Simple, functional, it's what I needed anyway.

Here's the code:

mass_contact.module

<?php

/* $Id$ */

/**
 * @file
 * Enables mass-mail contact forms to select roles.
 */

/**
 * Implementation of hook_help().
 */
function mass_contact_help($section) {
switch ($section) {
    case 'admin/help#mass_contact':
      $output = '<p>'. t('The mass contact module is simply a modified version of the core contact module.  It works opposite the latter, in that it allows site moderators (or anyone with permissions), to send mail to a set role or group of roles or even to all registered users.  The sender\'s own address is placed in the "To:" field, and all recipients are placed in the "Bcc:" field.  This means a copy gets sent to the sender, and none of the recipients can tell who else received the message, except by the category name, which appears in the "Subject:" field.') .'</p>';
      if (!module_exists('menu')) {
        $menu_note = t('The menu item can be customized and configured only once the menu module has been <a href="@modules-page">enabled</a>.', array('@modules-page' => url('admin/settings/modules')));
      }
      else {
        $menu_note = '';
      }
      $output .= '<p>'. t('The mass_contact module also adds a <a href="@menu-settings">menu item</a> (disabled by default) to the navigation block.', array('@menu-settings' => url('admin/build/menu'))) .' '. $menu_note .'</p>';
      return($output);
  }
}

/**
 * Implementation of hook_perm
 */
function mass_contact_perm() {
	return array('access mass contact form');
}
/**
 * Implementation of hook_menu().
 */
function mass_contact_menu($may_cache) {
	$items = array();
	if ($may_cache) {
		$items[] = array('path' => 'admin/build/mass_contact',
			'title' => t('Mass contact form'),
			'description' => t('Create a mass contact form and set up categories for the form to use.'),
			'callback' => 'mass_contact_admin_categories',
			'access' => user_access('administer site configuration'),
		);
		$items[] = array('path' => 'admin/build/mass_contact/list',
		'title' => t('List'),
			'callback' => 'mass_contact_admin_categories',
			'access' => user_access('administer site configuration'),
			'type' => MENU_DEFAULT_LOCAL_TASK,
		);
		$items[] = array('path' => 'admin/build/mass_contact/add',
			'title' => t('Add category'),
			'callback' => 'drupal_get_form',
			'callback arguments' => array('mass_contact_admin_edit'),
			'access' => user_access('administer site configuration'),
			'type' => MENU_LOCAL_TASK,
			'weight' => 1,
		);
		$items[] = array('path' => 'admin/build/mass_contact/edit',
			'title' => t('Edit contact category'),
			'callback' => 'drupal_get_form',
			'callback arguments' => array('mass_contact_admin_edit'),
			'access' => user_access('administer site configuration'),
			'type' => MENU_CALLBACK,
		);
		$items[] = array('path' => 'admin/build/mass_contact/delete',
			'title' => t('Delete contact category'),
			'callback' => 'drupal_get_form',
			'callback arguments' => array('mass_contact_admin_delete'),
			'access' => user_access('administer site configuration'),
			'type' => MENU_CALLBACK,
		);
		$items[] = array('path' => 'admin/build/mass_contact/settings',
			'title' => t('Settings'),
			'callback' => 'drupal_get_form',
			'callback arguments' => array('mass_contact_admin_settings'),
			'access' => user_access('administer site configuration'),
			'type' => MENU_LOCAL_TASK,
			'weight' => 2,
		);
		$items[] = array('path' => 'mass_contact',
			'title' => t('Mass contact'),
			'callback' => 'mass_contact_site_page',
			'access' => user_access('access mass contact form'),
			'type' => MENU_SUGGESTED_ITEM,
		);
	}
	return $items;
}

/**
 * Categories/list tab.
 */
function mass_contact_admin_categories() {
	$result = db_query('SELECT cid, category, recipients, selected FROM {mass_contact}');
	$rows = array();
	while ($category = db_fetch_object($result)) {
		foreach(explode(',',$category->recipients) as $rid) {
			$namerole = db_fetch_object(db_query('SELECT name FROM {role} WHERE rid = %d',$rid));
			$rolenamesa[] = ($namerole->name);
		}
		$rolenames = implode(', ',$rolenamesa);
		$rows[] = array($category->category, $rolenames, ($category->selected ? t('Yes') : t('No')), l(t('edit'), 'admin/build/mass_contact/edit/'. $category->cid), l(t('delete'), 'admin/build/mass_contact/delete/'. $category->cid));
	}
	$header = array(t('Category'), t('Recipients'), t('Selected'), array('data' => t('Operations'), 'colspan' => 2));

	return theme('table', $header, $rows);
}

/**
 * Category edit page.
 */
function mass_contact_admin_edit($cid = NULL) {

	if (arg(3) == "edit" && $cid > 0) {
		$edit = db_fetch_array(db_query("SELECT * FROM {mass_contact} WHERE cid = %d", $cid));
	}
	$form['category'] = array('#type' => 'textfield',
		'#title' => t('Category'),
		'#maxlength' => 255,
		'#default_value' => $edit['category'],
		'#description' => t("Will appear in the subject of your email as [category]."),
		'#required' => TRUE,
	);

	// get all roles except anonymous
	$allroles = db_query('SELECT rid, name FROM {role} WHERE rid > 1');
	while($roleobj = db_fetch_object($allroles)){
		$onerid = $roleobj->rid;
		$onename = $roleobj->name;
		$rolesarray[$onerid] = $onename;
	}
	$form['recipients'] = array(
		'#type' => 'checkboxes',
		'#title' => t('Roles to receive email'),
		'#options' => $rolesarray,
  		'#default_value' => explode(',',$edit['recipients']),
		'#description' => t('These roles will be added to the mailing list.  Note: if you check "authenticated users", other roles will not be added, as they will receive the email anyway.'),
	);
		
	$form['selected'] = array('#type' => 'select',
		'#title' => t('Selected'),
		'#options' => array('0' => t('No'), '1' => t('Yes')),
		'#default_value' => $edit['selected'],
		'#description' => t('Set this to <em>Yes</em> if you would like this category to be selected by default.'),
	);
	$form['cid'] = array('#type' => 'value',
		'#value' => $edit['cid'],
	);
	$form['submit'] = array('#type' => 'submit',
		'#value' => t('Submit'),
	);

	return $form;
}

/**
 * Validate the mass contact category edit page form submission.
 */
function mass_contact_admin_edit_validate($form_id, $form_values) {
	if (empty($form_values['category'])) {
		form_set_error('category', t('You must enter a category.'));
	}
	$recipients = $form_values['recipients'];
	foreach ($recipients as $checkr){
		if ($checkr > 1) return;
	}
	form_set_error('recipients', t('You must enter one or more recipients.'));
}

/**
 * Process the mass contact category edit page form submission.
 */
function mass_contact_admin_edit_submit($form_id, $form_values) {
	if ($form_values['selected']) {
		// Unselect all other contact categories.
		db_query('UPDATE {mass_contact} SET selected = 0');
	}
	
	//remove 0s for unselected roles, convert to csv
	$recipients = $form_values['recipients'];

	// if all authenticated users are already added, remove all roles
	if ($recipients[2] == 2)	{
		foreach ($recipients as $checkr){
			if ($checkr > 2){
				$recipients[$checkr] = 0;
			}
		}
	}

	foreach($recipients as $recip) {
		if ($recip != 0) $newformrec[] = $recip;
	}
	$form_values['recipients'] = implode(',', $newformrec);
	
	if (arg(3) == 'add') {
		db_query("INSERT INTO {mass_contact} (category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%s', %d, %d)", $form_values['category'], $form_values['recipients'], $form_values['reply'], $form_values['weight'], $form_values['selected']);
		drupal_set_message(t('Category %category has been added.', array('%category' => $form_values['category'])));
		watchdog('mail', t('Mass contact form: category %category added.', array('%category' => $form_values['category'])), WATCHDOG_NOTICE, l(t('view'), 'admin/build/mass_contact'));

	}
	else {
		db_query("UPDATE {mass_contact} SET category = '%s', recipients = '%s', reply = '%s', weight = %d, selected = %d WHERE cid = %d", $form_values['category'], $form_values['recipients'], $form_values['reply'], $form_values['weight'], $form_values['selected'], $form_values['cid']);
		drupal_set_message(t('Category %category has been updated.', array('%category' => $form_values['category'])));
		watchdog('mail', t('Mass contact form: category %category updated.', array('%category' => $form_values['category'])), WATCHDOG_NOTICE, l(t('view'), 'admin/build/mass_contact'));
	}

	return 'admin/build/mass_contact';
}

/**
 * Category delete page.
 */
function mass_contact_admin_delete($cid = NULL) {
	if ($info = db_fetch_object(db_query("SELECT category FROM {mass_contact} WHERE cid = %d", $cid))) {
		$form['category'] = array('#type' => 'value',
			'#value' => $info->category,
		);

		return confirm_form($form, t('Are you sure you want to delete %category?', array('%category' => $info->category)), 'admin/build/mass_contact', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
	}
	else {
		drupal_set_message(t('Category not found.'), 'error');
		drupal_goto('admin/build/mass_contact');
	}
}

/**
 * Process category delete form submission.
 */
function mass_contact_admin_delete_submit($form_id, $form_values) {
	db_query("DELETE FROM {mass_contact} WHERE cid = %d", arg(4));
	drupal_set_message(t('Category %category has been deleted.', array('%category' => $form_values['category'])));
	watchdog('mail', t('Mass contact form: category %category deleted.', array('%category' => $form_values['category'])), WATCHDOG_NOTICE);

	return 'admin/build/mass_contact';
}

function mass_contact_admin_settings() {
	$form['mass_contact_form_information'] = array('#type' => 'textarea',
		'#title' => t('Additional information'),
		'#default_value' => variable_get('mass_contact_form_information', t('Send mass emails using the following form.')),
		'#description' => t('Information to show on the <a href="@form">mass contact page</a>.', array('@form' => url('mass_contact'))),
	);
	$form['mass_contact_hourly_threshold'] = array('#type' => 'select',
		'#title' => t('Hourly threshold'),
		'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50)),
		'#default_value' => variable_get('mass_contact_hourly_threshold', 3),
		'#description' => t('The maximum number of mass contact form submissions a user can perform per hour.'),
	);
	return system_settings_form($form);
}

/**
 * Mass contact page
 */
function mass_contact_site_page() {
	global $user;

	if (!flood_is_allowed('mass_contact', variable_get('mass_contact_hourly_threshold', 3))) {
		$output = t("You cannot send more than %number messages per hour. Please try again later.", array('%number' => variable_get('contact_hourly_threshold', 3)));
	}
	else {
		$output = drupal_get_form('mass_contact_mail_page');
	}

	return $output;
}

function mass_contact_mail_page() {
	global $user;

	$result = db_query('SELECT cid, category, selected FROM {mass_contact} ORDER BY weight, category');
	while ($category = db_fetch_object($result)) {
		$categories[$category->cid] = $category->category;
		if ($category->selected) {
			$default_category = $category->cid;
		}
	}

	if (count($categories) > 0) {
		$form['#token'] = $user->name . $user->mail;
		$form['contact_information'] = array('#value' => filter_xss_admin(variable_get('mass_contact_form_information', t('Send a mass email message using the contact form below.'))));
		$form['name'] = array('#type' => 'textfield',
			'#title' => t('Your name'),
			'#maxlength' => 255,
			'#default_value' => $user->uid ? $user->name : '',
			'#required' => TRUE,
		);
		$form['mail'] = array('#type' => 'textfield',
			'#title' => t('Your e-mail address'),
			'#maxlength' => 255,
			'#default_value' => $user->uid ? $user->mail : '',
			'#required' => TRUE,
		);
		$form['subject'] = array('#type' => 'textfield',
			'#title' => t('Subject'),
			'#maxlength' => 255,
			'#required' => TRUE,
		);

		// If there is more than one category available and no default category has been selected,
		// prepend a default placeholder value.
		if (!isset($default_category)) {
			$categories = array(t('--')) + $categories;
		}
		$form['cid'] = array('#type' => 'select',
			'#title' => t('Category'),
			'#default_value' => $default_category,
			'#options' => $categories,
			'#required' => TRUE,
		);

		$form['message'] = array('#type' => 'textarea',
			'#title' => t('Message'),
			'#required' => TRUE,
		);

		$form['submit'] = array('#type' => 'submit',
			'#value' => t('Send e-mail'),
		);
	}
	else {
		$form['#error'] = array('#value' => t('The mass contact form has not been configured.'));
	}
	return $form;
}

/**
 * Validate the site-wide contact page form submission.
 */
function mass_contact_mail_page_validate($form_id, $form_values) {
	if (!$form_values['cid']) {
		form_set_error('category', t('You must select a valid category.'));
	}
	if (!valid_email_address($form_values['mail'])) {
		form_set_error('mail', t('You must enter a valid e-mail address.'));
	}
}

/**
 * Process the mass contact page form submission.
 */
function mass_contact_mail_page_submit($form_id, $form_values) {

	global $user;

	// E-mail address of the sender: as the form field is a text field,
	// all instances of \r and \n have been automatically stripped from it.
	$from = $form_values['mail'];

	// Compose the body:
	$message[] = t("!name sent out a group email from !site.", array('!name' => $form_values['name'], '!site' => url(NULL, NULL, NULL, TRUE)));
	$message[] = $form_values['message'];

	// Tidy up the body:
	foreach ($message as $key => $value) {
		$message[$key] = wordwrap($value);
	}

	// Load the category information:
	$contact = db_fetch_object(db_query("SELECT * FROM {mass_contact} WHERE cid = %d", $form_values['cid']));
	
	// Create the recipients
	$roles = explode(',',$contact->recipients); 
	foreach ($roles as $r)
	{
		if ($r == 2){	// all users
			$recipients = db_query("SELECT name, mail FROM {users} WHERE uid > 0");
			while ($obj = db_fetch_object($recipients)) {
				$rname = $obj->name;
				$rmail = $obj->mail; 
				if($rname != $user->name) $recipientouta[$rname] = $rmail;			
			}
			break;
		}			
		else 
		{ //get from users_roles, then role -> user
			$uids = db_query("SELECT uid FROM {users_roles} WHERE rid = %d",$r);
			while ($obj = db_fetch_object($uids))	{
				
				$uid = $obj->uid;
				$ruid = db_fetch_object(db_query("SELECT name, mail FROM {users} WHERE uid = %d",$uid));
				
				$rname = $ruid->name;
				$rmail = $ruid->mail; 
				
				if($rname != $user->name) $recipientouta[$rname] = $rmail;			
			}			

		}
	}
	foreach ($recipientouta as $rnamea=>$rmaila)
	{
		$recipientout .= $rnamea." <".$rmaila.">, ";
	}
	$headers['Bcc'] = $recipientout; // hidden recipients
	
	// Format the category:
	$subject = t('[!category] !subject', array('!category' => $contact->category, '!subject' => $form_values['subject']));

	// Prepare the body:
	$body = implode("\n\n", $message);

	// Send the e-mail to the recipients:
	drupal_mail('mass-contact-page-mail', $from, $subject, $body, $from, $headers);

	// Log the operation:
	flood_register_event('contact');
	watchdog('mail', t('%name-from sent a mass e-mail to the %category group.', array('%name-from' => $form_values['name'] ." <$from>", '%category' => $contact->category)));

	// Update user:
	drupal_set_message(t('Your message has been sent to: -emails',array('-emails'=>$recipientout)));

	// Jump to home page rather than back to mass contact page to avoid contradictory messages if flood control has been activated.
	return('');
}

mass_contact.info

; $Id$
name = Mass Contact
description = "Enables mass mail contact forms to selected roles"

version = "5.x-1.x-dev"
package = "email"

mass_contact.install

<?php
// $Id: mass_contact.install,v 0.1a 2007/01/14 23:29:48 yuttadhammo Exp $

/**
 * Implementation of hook_install().
 */
function mass_contact_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {mass_contact} (
        cid int unsigned NOT NULL auto_increment,
        category varchar(255) NOT NULL default '',
        recipients longtext NOT NULL,
        reply longtext NOT NULL,
        weight tinyint NOT NULL default '0',
        selected tinyint NOT NULL default '0',
        PRIMARY KEY (cid),
        UNIQUE KEY category (category)
      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {mass_contact} (
        cid serial CHECK (cid >= 0),
        category varchar(255) NOT NULL default '',
        recipients text NOT NULL default '',
        reply text NOT NULL default '',
        weight smallint NOT NULL default '0',
        selected smallint NOT NULL default '0',
        PRIMARY KEY (cid),
        UNIQUE (category)
      )");
      break;
  }
    drupal_set_message(t('All tables required by the mass_contact module have been created.'));

}
ivko’s picture

line #398 should be changed to avoid adding an extra comma at the end of recepients list (some SMTP servers rejects empty address)
Fo example to: $recipientout .= (empty($recipientout)?"":", ").$rnamea." <".$rmaila.">";

NoahY’s picture

Thanks for spotting it... I worked some more on it, though, and used an implode(',', $recipientout) command instead. Also added a new node type on install and node-adding a cc for each mail message. The whole module is here:

http://drupal.org/node/106944#comment-182723

sepeck’s picture

It's not that it was overlooked, it's just that no one has contributed a module that had such funtionality as few needed such a funtion.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

mfizzel’s picture

interesting...how could only a few need to contact their members regarding their sites? Especially community based sites...

drupal has just about EVERYTHING I need, I'm kinda shocked I can't email my members!

marknewlyn’s picture

Hi

I do need this feature and have found that Simplenews plus the patch from this thread (which allows by-role subscription to a newsletter by admin) works very well for me. It has cron features so that the emails get sent in batchs (from Simplenews) and to subscribe all members is easy with the patch. (Of course you need to remember to set cron up to run properly unlike me ;)

I think that this IS a necessary feature so if you could encourage the creation of the contrib module for Simplenews you wouldn't be alone.

Mark

mfizzel’s picture

does that only work for 4.7?

sepeck’s picture

This is a more complicated discussion.

You can email your members. I am not saying you can't. I meant that no one has either seen the need to email 'their' members OR contributed their solution (in the form of a module or handbook page) to do this.

Everyone brings their needs and ways of working to their implementation of Drupal. This is good because it means that often more people benefit from others solutions to their needs. I mention this difference because I have around 14 sites and not one of them would ever need a mass or global notification to it's users, but that's the nature of 'my' sites and not yours.

In the last few weeks I think you are the third such to mention a need in the forums. Again, this is good. It means that someone will hopefullly either A, solve it and give you a solution or B, help you solve it and you can give the solution to the community.

You can get all your users email address with a SQL query, something like SELECT init FROM users; (works on 4.6) will dump a list of all the email addresses of your users. This may solve your short term notification needs.

You can look at the Simplenews thread above. Or perhaps you can modify privateMSG and add this feature and then contribute it back to the privateMSG module maintainer.

All of this helps increase the diversity of Drupal's audience and it's capabilities.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

mfizzel’s picture

something like SELECT init FROM users;

thanks, I was able to export my users email addresses as a csv file

Can anyone recommend a bulk mailing program or service?

underpressure’s picture

Steven, The people who are requesting this function do not understand PHP so they can't right it themselves.

I disagree that only a few need this function, I think the reason for little request are the work arounds people have had to use.

--------------------->
underpressure
http://ravalonline.com

sepeck’s picture

I understand that they can't. This is open source. They have some options.
1. Learn php. - This is a good thing for using Drupal in any case. Of course, I haven't really bothered myself.
2. Use a work around. - Several listed, mine included.
3. Pay someone. - self explanitory but people get upset when this option is mentioned.
4. Hope someone will contribute. - wait. wait. wait. hope. plead. get mad. rant on forums. rant on blog. ah well.

It's not mean, it's not a slam or a put down, it's telling people their options.

Only a few of the thousands and thousands of Drupal based sites out there need this functionality. You know how I know? If it were a more common need, it would be a contrib module. Supported by someone or a group of interested someone's. If it's not written and supported by someone, then it must not really be all that important or someone would learn enough php or pay someone and maybe, just maybe share their solution.

This is the weakness and the strength of Open Source software. If you are not able, then you must rely on others. You can relly on others by paying them or finding someone who is really nice. Failing that, you can learn enough to do for yourself.

I'm not saying it's not a valid function. I'm not saying you couldn't use it. I'm saying that someone, somewhere needs to do the work. Saying;

how could this feature be overlooked?

or

I'm kinda shocked I can't email my members

doesn't mean that it will get done. It merely means someone is shocked and they felt something was overlooked for their needs.

And there is still not a module to do this.

Of course, I did provide a work around that someone could use to implement into a module if they wanted to.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

underpressure’s picture

Steven, I didn’t take your post the wrong way I know you mean well, I just do not agree 100% with your point of view.

1. Learn php. - This is a good thing for using Drupal in any case. Of course, I haven't really bothered myself.

I'm sure many newbies (Drubies?) would love to learn PHP, but not everyone has the time

2. Use a work around. - Several listed, mine included.

The work arounds are similar but not exactly a standard massmailer so there are not going to work for most (but they are always welcomed)

3. Pay someone. - self explanitory but people get upset when this option is mentioned.

If it was only that easy, not all can afford to do this.

4. Hope someone will contribute. - wait. wait. wait. hope. plead. get mad. rant on forums. rant on blog. ah well.

Shame it's against the law to hold someone by gun point

I don't think that because a contib doesn't exist means that there isn't much need. It seems to me like the people who want this feature do not have the skills to mail it, let’s not forget that there was a massmailer in 4.6

I’m not saying you are wrong, there is substance to your point, but I think you truly understand what it’s like for us who would like this feature.

As for shocked, this is because it seems like a standard feature for any web program.

--------------------->
underpressure
http://ravalonline.com

sepeck’s picture

but we are back to people scratch their own itch and this is one that some one who is able hasn't felt like doing. As to the contrib module mass mailer, well it sort of proves my point, there isn't a version for 4.7 and it didn't work on Windows anyway.

'Standard web program'. That phrase is such an interesting phrase. It implies that there is an agreed upon consensus on what such a phrase means. There isn't. You won't find it. That may be the stumbling block here. As I said, I don't need it. As someone who deals with email on a regular basis I consider sites that send me email without my express permission, my doing something like oh, signing up for the newsletter on my own, to be spammers and block accordingly.

In any case, I am tracking my thoughts on why Drupal is different. People bring their expectations with them and often skip reading a projects history and mission. We also probably do not do as good a job on explaining it so we'll see if we can get something ready by the time 5.0 is released.

I find the gun point reference disturbing and threatening and think it's an excellent idea it's against the law in most countries and very NOT relevant to the conversation.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

underpressure’s picture

I find the gun point reference disturbing and threatening and think it's an excellent idea it's against the law in most countries and very NOT relevant to the conversation.

Cheap humor Steven.

--------------------->
underpressure
http://ravalonline.com

sepeck’s picture

I have never felt a threat to be humourous in any context.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

underpressure’s picture

I have a crazy idea, this sounds too crazy but I’ll still put it out there, based on the 4.6 mass mailer, it seems like building a mass mail module requires lots of code to be written. I was wondering if it would be easier to write a module that would retrieve the current list of members email addresses from Drupal and then load them in the address bar of thunderbird.

I’m putting this out there in the hope it may present itself as an interesting challenge or if possible be able to persuade a Thunderbird developer to write it.

If someone won’t write it because they don’t need it perhaps a challenge would. The odds would double because you can approach 2 communities instead of one.

--------------------->
underpressure
http://ravalonline.com

Cromicon’s picture

As to the learn PHP reference, I learnt a LOT in one day alone! I've easily spent DAYS trying to figure out how to do something in a module slightly different to its original design. Now I am more confident I can.

If I stick at it, in a week I can see me customising modules with relative ease or at least a less bumpy ride. So much less time wasted on trying to figure things out without having a clue at all.

In the near future, I really hope to contribute code to modules. Yes it does take time but along the way I get to understand and customise some modules the way I want, which is the result you want.

If you take the plunge, you will not regret it. Well, not much. ;-)

http://drupal.org/node/82995

kweisblatt’s picture

How did this turn into a fight about getting more stuuf for free? :D

Anyways, I just used the simplenews module with the patch for sending out an update notice to my very small list of users and I think it does what everyone here wants. Just go to http://drupal.org/node/49980 it's reply #40 for the latest patch. Upload it to your modules, activate it, go to http://yoursite.com/?q=admin/newsletter (type in your site name first silly), then click 'subscriptions' then you will see a 'role subscription' option. Click that then you will see a list of newsletters you have created. Now, a lot of people are complaining that they don't need a so called "newsletter" so let's call them emails with the ability to save :)

If you haven't created your newsletter (cough... I mean email) then I think you will have a default one named www.yoursite.com newsletter. Expand that and you will see your user roles. Click all to subscribe all to that specific newsletter.

I created a newletter called "Update" which is when I want to send ALL members an update notics on the site. I clicked 'newsletter' 'add newsletter' and added 'update.'

To create the email I go to 'create content' and select to create a new "newsletter." Title it, select which newsletter to add it to (mine was "update"). I sent out an html email to my users that I created. I entered the html in the message section, and expanded the 'input formats' and chose 'full html.' I then chose 'html' again under the format options. There's other cool options below that, I won't go through them all... so hopefully you get the idea by now.

As far as learning PHP... I am trying because there is a very important feature that I would like and I don't think it will be done anytime soon. I want an option within the subcriptions module to give users the ability to choose to subscribe to specific cck fields filled in. So, I will open up the subscriptions module, crack open the php book, and try and figure something out. If someone figures it out before me....pheew! If not, well I guess I learn how to create a patch which isn't a bad thing!

~~~~~~~~~~~~~~~~
Kris
Current project: www.cribfax.com

underpressure’s picture

I wouldn't call it fighting since I never got hostile or think anyone else were. All I see is two people with different points of view and expressing them.

You know, now you that you mention it, perhaps the best solution would be to create a massmailer from simple news, more fine tuned for that pourpose than a patch> It woud take less to recode or even a feature request.

--------------------->
underpressure
http://ravalonline.com

kweisblatt’s picture

what did you call it again.... humor?? :D Twas a joke.....

Did you check out the patch I mentioned? You can mass mail from that.

~~~~~~~~~~~~~~~~
Kris
Current project: www.cribfax.com

underpressure’s picture

No, I didn't, but now that I think about it, it sounds like a good start to a feature specific module for mass mailing.

You know, it doesn't sound like a bad project for a newbie, strip and add a few functions and you've got a mass mailer module, since all you would mainly need to know is how to write and add the specific functions instead of starting from scratch .
--------------------->
underpressure
http://ravalonline.com

marcoBauli’s picture

5. Ask a developer an estimate cost to upgrade the module. Then spread the voice (actually this post might be already a good amphitryon) and involve as many interested people as possible to share the expenses with.

If Mail for 4.7 is that relevant, shouldn't be hard to find other Drupallers wanting to co-sponsor the bounty with a 100$ or something. ;)

jdsaward’s picture

I am curious.

Why "SELECT init FROM users;"

rather than

"SELECT mail FROM users;"

Just trying to understand.

sepeck’s picture

Because I was in a hurry when I looked at the db and it's not a specialty of mine. Also init is the very first thing you enter for an email address -- OR -- it picks up your logon id from a site that allows Drupal style authentication. Either way it serves as a nice spot for the originating data.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Muslim guy’s picture

Shocked?

It existed and I used it a lot - it's MAIL.module for 4.6.x

But for 4.7.x it doesnt work (?)

jsloan’s picture

mfizzel’s picture

Yea I've actually downloaded it and installed it but I can't figure out how to send mass emails to everyone...is that possible with this module?

The confusing thing to me is that with this module you create mail as you would a story or page...but I don't see anywhere to enter email addresses or to choose who it sends to.

jsloan’s picture

After you install the mail module you need to enable the content type for "mail". Then when you create a content type of "mail" you will see a checkbox for each user role on your site. This is working for me with a fresh install of 4.6 and the 4.6 download of the mail module.

mfizzel’s picture

Thanks for the tip jsloan, I thought I had enabled it but it wasn't.

davidgibbens’s picture

Just to clarify what seems to be the position (from the point of view of a very non-techie site administrator):
a) quite a few of us see the need to send out emails to our site members (one-way info from admin - could be tips, hints, breaking news for those not using notify etc); as with the original poster mfizzel, to me this seems really fundamental
b) there was a claim from Steven Peck that the functionality didn't exist within Drupal and hadn't been created to date because there had been insufficient need for it: but this statement seemed to be in error because:
c) there is the Mail module (which I have installed on my 4.6 site) and have used and which seems relatively simple
d) BUT there is not apparently an intention to uprade it to 4.7 because, the site documentation claims, "There are no plans to update this module to 4.7, as other mailing modules are now available for this module's tasks. If you wish to send out content as mail, try the Send module in combination with Mime Mail."
e) HOWEVER: my reading of the 4.7 documentation doesn't show up anything which seems to replicate what Mail does in a simple and straightforward way - which leaves me frankly baffled... I am having problem seeing the combination of Send and Mime Mail in that way, certainly, as one of the key features of the Mail module is to distribute mail by user role

So if anyone can shed light on this, correct any errors, make it clearer how to use 4.7 modules to replicate what Mail does for 4.6 or wants to join forces in helping persuade someone to update the Mail module to 4.7 I hope you will comment.
Thanks.

davidgibbens’s picture

Just to clarify what seems to be the position (from the point of view of a very non-techie site administrator):
a) quite a few of us see the need to send out emails to our site members (one-way info from admin - could be tips, hints, breaking news for those not using notify etc); as with the original poster mfizzel, to me this seems really fundamental
b) there was a claim from Steven Peck that the functionality didn't exist within Drupal and hadn't been created to date because there had been insufficient need for it: but this statement seemed to be in error because:
c) there is the Mail module (which I have installed on my 4.6 site) and have used and which seems relatively simple
d) BUT there is not apparently an intention to uprade it to 4.7 because, the site documentation claims, "There are no plans to update this module to 4.7, as other mailing modules are now available for this module's tasks. If you wish to send out content as mail, try the Send module in combination with Mime Mail."
e) HOWEVER: my reading of the 4.7 documentation doesn't show up anything which seems to replicate what Mail does in a simple and straightforward way - which leaves me frankly baffled... I am having problem seeing the combination of Send and Mime Mail in that way, certainly, as one of the key features of the Mail module is to distribute mail by user role

So if anyone can shed light on this, correct any errors, make it clearer how to use 4.7 modules to replicate what Mail does for 4.6 or wants to join forces in helping persuade someone to update the Mail module to 4.7 I hope you will comment.
Thanks.

Muslim guy’s picture

I second that....

the closest for 4.7.x is notify, but purely voluntary as per user, unlike Mail.module

Mai.module works only for 4.6.x..I wish I could tweak PHP ...:)

Have you posted the request at the module page?

BTW, almost the same thread for mail.module
http://drupal.org/node/72829#new

The instruction:
*export your mail addresses and send them
http://drupal.org/node/65158#comment-122973
only use something like SELECT mail FROM users;
*

How is this executed, can we use `database.module' to execute it, and inside query or script window?

kweisblatt’s picture

I just want to send a mail to my users notifying them of a few changes.....
I don't need subscriptions and the mail module seems to be simple and exactly what I need. I downloaded send and mimemail but I can't send mailto my users?? Although I like the send page to friend feature....if I could get it to work.

I guess I have to export my users email addresses and do it that way :( I just want to click a button and send!!

~~~~~~~~~~~~~~~~
Kris
Current project: www.cribfax.com

Muslim guy’s picture

I would learn PHP and try upgrading MAIL.module which is for 4.6.x and doesnt work for 4.7.x

Is it simple to do this? I too am dying to use MAIL.module for new Drupal and this might motivate a non-PHP programmer to hack this one particular module

kweisblatt’s picture

I used the above simplenews module with the patch to allow admins to select user roles for each "newsletter" they want to send. I just wanted to send mail to users about updates, so I selected all users and emailed them the info. It allows you to send html emails and keeps a copy of them which is cool. I don't know how this would compare to mail.module?

~~~~~~~~~~~~~~~~
Kris
Current project: www.cribfax.com

Muslim guy’s picture

Does it work? Drupal 473?

If SimpleNews can be used to email ALL USERS with just one click, then it can fill in the MAIL function - I havent used SimpleNews - I used MAIL extensively everytime a new content (text, image, webform, anything) is created, I click `Send to users' and it is sort of sending afresh newspaper right to the homes on the reader tables

You said about *Patching SimpleNews* - could you share with us here the link to the patch

Because I saw in admin/newsletter/settings no way of selecting roles to send newsletter - I know that SImpleNews is sort of VOLUNTARY but how to make all users receive it (including those that didnt choose to subscribe to newsletter in the side block)

*Hmmm
Fatal error: Call to undefined function: form_select() in /home/*/public_html/*/modules/mail/mail.module on line 39

If I were PHP literate, I would have volunteered to do something about it :) Anyone can guide me please?

kweisblatt’s picture

Sorry Muslimguy, just saw this now.. here is the patch: http://drupal.org/node/49980

Make sure you go into the admin/modules and enable simplenews_roles module. After you do this, you will see a new tab in the subscriptions.
~~~~~~~~~~~~~~~~
Kris
Current project: www.cribfax.com

marcoBauli’s picture

there's a module called profile_cvs that actually lets you export into a cvs file custom profile fields for choosen role(s).

Pretty easy then to import in a third party mailing list program.

Hope this helps

marknewlyn’s picture

Hi

The best thing is definitely to add the role subscription feature to the subscriptions module. I think it makes sense because:
1) subscriptions is well maintained and very versatile
2) on a working site roles define people who need to be notified about certain things
3) the patch exists already

I really think this is a solid and the best way to go.

Mark

C-Watootsi’s picture

Brasquido put together a thorough overview of the 11 current options available for mass mailing, here.

Muslim guy’s picture

Lets VOTE!

The proposal is to upgrade MAIL.module to Drupal 4.7.x and 5.0 and INCLUDE this nifty module into Drupal installer

kweisblatt’s picture

got my vote

~~~~~~~~~~~~~~~~
Kris
Current project: www.cribfax.com

underpressure’s picture

mine too
--------------------->
underpressure
http://ravalonline.com

isi-1’s picture

mine too

trishredhop’s picture

and if this site could e-mail these voters when it's done? oh, dare to dream...

Christefano-oldaccount’s picture

+1

kweisblatt’s picture

Didn't know if everyone saw this, but mail module has been updated to 4.7 http://drupal.org/project/mail
~~~~~~~~~~~~~~~~
Kris
Current projects: www.cribfax.com
www.myabatherapist.com

Muslim guy’s picture

Thanks for pointing it

And many THANKS to NEDJO

lias’s picture

It's not altogether functioning just yet but he is actively working on it as of 24-1-07 at the bottom of http://drupal.org/node/106944