Mass email not possible
igorik - November 30, 2008 - 13:33
| Project: | Invite |
| Version: | 6.x-2.0-alpha1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Description
Hi
I found when I enable mass inviting for authenticated users, all messages except the first one have word 'array' instead user message in email body.
The first message has correcty user message inside it.
Using latest dev version.
thanks
Igorik
http://www.somvprahe.sk

#1
Hi,
I'm having the same problem.
The first email its sent to is fine, and also its fine if only inviting one person. However if more, the second onwards all receive 'Array' instead of the message the inviting user fills in.
I also get the error:
warning: preg_match() expects parameter 2 to be string, array given in /var/www/vhosts/thesharehood.org/httpdocs/includes/bootstrap.inc on line 732.
and that comes from drupal_validate_utf8($text) in bootstrap.inc, which is mainly called by check_plain() I believe.
check_plain() is called about 5 times in invite.module, but I can't find any where what is being passed is an array rather than a string.
Anybody got any other ideas?
thanks,
Rachel
#2
I also have the error with the "array" in mass emails (except the first mail of a mass email)
6.x-2.x-dev (inkl. patch invite.module.322748.diff) -> http://drupal.org/node/322748#comment-1208647
#3
I had the same problem with an invite patched twice according to:
- http://drupal.org/node/330233
- http://drupal.org/node/322748#comment-1208647
The cause of the problem is dual use of the variable $message in the foreach loop of "Forms API callback; process submitted form data" in the invite.module.
Solution:
Change the following code (in my double patched version found in line 1081 and 1082, in unpatched modules mayby found on a place that is a little bi different):
$message = drupal_mail('invite', 'invite', $email, $language, $params, $from, TRUE);
if (1 || $message['result']) {
in:
$messagedrupal_mail = drupal_mail('invite', 'invite', $email, $language, $params, $from, TRUE);
if (1 || $messagedrupal_mail['result']) {
Maybe time for a new release?
#4
#5
It works, thanks!
#6
your code is working fine thanks for the help
#7
This works like a charm.
______________________
Let's talk statistics...
www.stattalk.org
#8
is there a patch for this bug?
#9
Thanks much Jaapx, this solution works! Hope it makes it into the next release.
#10
Patch attached
#11
$ patch < invite.module.custommsg.patchpatching file invite.module
patch: **** malformed patch at line 11: invite_get_subject();
? ... guess I can do this by hand then ...
I ran the patch on both aplha1 & the dev with the same error.
#12
I can confirm this does fix the broken mass email functionality.
Not sure why the patch was failing .. this is about as simple as a patch can get .. just two words being replaced! lol