On the 'signup broadcast' tab, it says the message will be sent from the node owner's email address but in fact, the email the recipient receives says it comes from the site admin email address and the reply-to email address is the site owner.

this is malfunctioning right? is there a fix?

Comments

dww’s picture

Category: support » bug
Status: Active » Postponed (maintainer needs more info)

I think I see the bug. If possible, a work-around would be to try as a user with 'administer site configuration' permission and see if it works. If that works, and it fails for regular users, I'm sure I see the bug, and it should be pretty easy to fix.

dww’s picture

Assigned: Unassigned » dww
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new874 bytes

This is totally untested, but it should solve the bug for regular users. Please let me know if it works.

mdowsett’s picture

thanks for looking into this...but I don't know WHERE I put this patch? What file? Does it replace some lines?

dww’s picture

mdowsett’s picture

thanks....I don't feel comfortable running command line commands....is there another way to make it happen?

dww’s picture

i suggest you start getting comfortable with two important concepts/operations:

a) working on a test site
b) using the command-line

those skills will serve you well in the drupal ecosystem, and the open source world in general. ;)

mdowsett’s picture

by chance is this worked into a signup.module update yet?

dww’s picture

Of course not -- or I would have changed the status to "fixed" when I committed it. The status is accurate: this needs review. Someone who cares about this problem needs to apply this patch and see if it solves the bug.

mdowsett’s picture

sorry to cause your frustration.

I have made slight modifications to the signup.module so I got an error when trying to run the patch (I tried to learn!!!). I'm assuming it's looking for similarly (proper) coded lines to rewrite and since I've added some lines, it doesn't match up.

Is that an accurate statement? This is the first patch I've tried to run.

I also tried to do it manually

I replaced/removed this line:
- $from = $form_values['from'];

And added these in it's place:
+ if (user_access('administer site configuration')) {
+ $from = $form_values['from'];
+ }
+ else {
+ global $user;
+ $from = $user->mail;
+ }

But it had no effect.

Thanks for your advice (if you have any more) and if not, I'll have to wait for an updated module someday.

Thanks for this great module too - it's the core of this site I'm doing.

wylbur’s picture

We are using the signup module, and have given users on the site permission to use the Signup Broadcast feature.

When site users access the Signup Broadcast, there is a message at the bottom of the page that states "This message will be sent from: xxx@xxx.xxx" (xxx@xxx.xxx being the currently logged in user's email address). However, messages generated from the signup module were sent from the site admin email address.

I applied this patch, and the subsequent emails were marked as 'sent' and 'reply-to' with the site user's email address rather than the site admin's email address.

Double-plus-good here! Thanks for the good work!

mdowsett’s picture

StatusFileSize
new21.74 KB

I reviewed the changes I made and it is all good (should be)...but it isn't.

It's even stranger than I thought.

When I send broadcast emails from the admin user (UID=1), it sends it from that user's email address (working properly).

But when I send broadcast emails from a user that owns that event node, it sends it from the email address I have as the site's email address (set at /admin/settings/site-information)...even tho when that user is on their /node/xxx/signup-broadcast page, it does say that it will be sent from their email address.

I've attached my signup.module file here in hopes you could review the changes I made (at line 2333).

I'd REALLY appreciate help with this.

mdowsett’s picture

Status: Needs review » Active

pretty please?! :) I could still use some help on this.

dww’s picture

Status: Active » Fixed

- I don't give out free support to people who modify the code and then have problems. If you want to hire me to debug your problems, use my contact tab.

- Looks like #10 actually tested and confirmed the patch works, so I committed it to HEAD. It'll be out in 5.x-2.5 whenever I release that.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

mdowsett’s picture

Status: Closed (fixed) » Active

I hate to open up this ticket after all this time but I still can't get this fixed and I can't apply the patch due to some custom code added elsewhere in that file.

Here is my section for getting the node-owner's email address as the sent-from person:

/**
 * Send an email message to all those signed up to an event.
 *
 * @param $form_id
 * @param $form_values
 */
function signup_broadcast_form_submit($form_id, $form_values)
{
	$addresses=signup_get_email_addresses($form_values['nid']);

	if (is_array($addresses))
	{
		if (user_access('administer site configuration')) {
			$from=$form_values['from'];
			}
		else
		{
			global $user;
			$from=$user->mail;
		}

		$subject=$form_values['subject'];
		$event=node_load($form_values['nid']);
		foreach ($addresses as $signup) {
			$mail_address=$signup->anon_mail ? $signup->anon_mail : $signup->mail;
			$trans=array(
				'%event'=>$event->title,
				'%username'=>$signup->uid ? $signup->name : variable_get('anonymous', t('Anonymous')),
				'%useremail'=>$mail_address,
//        '%info'=>$signup_info,
			);

			$trans['%time']=signup_format_date($event);

			$message=strtr($form_values['message'], $trans);
			drupal_mail('signup_broadcast_mail', $mail_address, $subject, $message, $from);
			watchdog('signup', t('Broadcast email for %event sent to %email.', array('%event'=>$event->title, '%email'=>$mail_address)), WATCHDOG_NOTICE, l(t('view'), 'node/'. $event->nid));
		}
	}
	drupal_set_message(t('Message sent to all users who have signed up'));
}

I've been struggling with this for over a year now and I'm hoping someone can tell me what's wrong in it.

MANY thanks.

dww’s picture

Status: Active » Closed (fixed)

I don't provide free support for your customized (aka hacked) copy of my code. ;) if you want help with this, contact me privately about hiring me. At the very least, please have the courtesy to open a new support request in cases like this, instead of reopening a closed issue. Thanks.