MyBB Community Forums

Full Version: [F] Future mass mailings [C-StefanT]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am not sure if this is a bug or a suggestion.

1. Create a new mass mail and choose to send it to the members of one usergroup and to send it some time in the future
2. Members that registered between the creation and the transmission do not get the mailing

One user of the german community complained about that issue because she's preparing her mainings for the future and new members do not get these mails.
In inc/tasks/massmail.php find:

// Need to perform the search to fetch the number of users we're emailing
$member_query = build_mass_mail_query(unserialize($mass_email['conditions']));

add after:

$count_query = $db->simple_select("users u", "COUNT(uid) AS num", $member_query);
$mass_email['totalcount'] = $db->fetch_field($count_query, "num");

Tell me if that works
The recipient counter in the ACP does not get updated but new members get the message now. Smile
(2009-06-22, 12:35 PM)Michael S. Wrote: [ -> ]The recipient counter in the ACP does not get updated but new members get the message now. Smile

I don't think it would be a good idea to recount the # of members that match the mass mail query every-time a member registers.
That's right. But you could update the number during the processing of the task so that the number of recipients is correct in the mass mailing archive.

In inc/tasks/massmail.php find:
$update_array['sentcount'] = $mass_email['sentcount'] + $sentcount;
Above or below add:
$update_array['totalcount'] = $mass_email['totalcount'];
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

Unless there's any objections to the above?

With regards,
MyBB Group
Sounds fine - it isn't a perfect fix though