multiple categories

skizzo - September 17, 2007 - 15:02
Project:Mass Contact
Version:5.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:oadaeh
Status:active
Description

If a user belongs to three all "categories" (eg: roles A and B and C)
and a mail is sent to multiple categories, will he/she receive
multiple copies of the same message? If that is the case, could
such occurence be avoided? Thanks.

#1

oadaeh - September 17, 2007 - 17:22
Component:User interface» Code
Assigned to:Anonymous» oadaeh

It should do that already, but I'll double check to make sure.

#2

oadaeh - January 23, 2008 - 18:42
Version:5.x-2.4-beta» 5.x-2.x-dev
Category:support request» bug report

Okay, this doesn't actually work. I will try to come up with a fix in the next few days.

#3

oadaeh - July 8, 2008 - 16:14
Category:bug report» feature request

After reviewing the code and thinking about this issue at length, I don't believe this is a bug. It may be a feature request, but with the way the code currently works, one that would be difficult to impossible to implement. (Well, probably not impossible, but maybe so difficult as to make me not want to attempt it.)

The module processes each category separately, discarding the information about the previous category when a new one is started. I would need to save each user in a separate data location of some sort (variable, database, ???) as the category was being processed. Then I would need to check that data location for each successive user of each successive category. Also, I would be arbitrarily deciding which category gets sent to the user.

I would also probably want to give administrators the option of whether to allow this behavior or not, as some people might want to receive the multiple e-mails.

#4

sven33 - August 1, 2008 - 06:43

I'd like to see this "feature" implemented too.

I raised an bug report http://drupal.org/node/289875 as didn't notice this item when looking through bug list.

(Note, we've switched off putting the category title in the subject line as that is not a feature we use at all. Hence for us there is no need to process each category one at a time)

#5

cosmicdreams - November 19, 2008 - 05:37

This is my version of the mass contact module. It has three main differences.

1) the while loop that begins at line 1145 ends earlier. The main purpose of the loop in the original module was for looping through all categories and sending out a mass email with a different subject for each category. I didn't need this since they want my clients don't care about small changes in the subject line.

Now the while loop's purpose is to build a list recipients. I kept the opt-out and role-driven list modification features.

2) After the list of recipients is built, I dedup the list with the array_unique function.

3) The subject is restricted to the value that's passed from the form. No category specific text was kept. This subject setting occurs later in the foreach recipient loop. (probably should refactor).

It works for me. Let me know how I can cleanup this change for general consumption.

AttachmentSize
scratch2.php_.txt 59 KB
 
 

Drupal is a registered trademark of Dries Buytaert.