I am getting the following errors...

Error

Email is received, but it has the same background color I am using on my site and simply says "Array".

Please help!

-PK-

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pixelsticks’s picture

I'm receiving the same error. I'm running PHP 5.2.x. Mine is in response to a rule action "Send HTML email to all users of a role". Another action in the same rule is sending with no trouble. Will be upgrading to PHP 5.3 shortly and will report back whether that helps.

Any thoughts?

pumpkinkid’s picture

I hope the issue is not with php5.2.x because upgrading to 5.3.x is not an option for me...

What makes you think that's the problem?

Let us know what you find.

pixelsticks’s picture

Same issue with PHP5.3.x, so you're safe there. Nothing made me think it would work, I just needed to upgrade anyway and hoped to kill 2 birds with one stone. I'll keep playing with it and try to isolate the issue. Let me know if you find anything.

pumpkinkid’s picture

Will do

pixelsticks’s picture

Is your error stemming from a rule? If so, are you sending ton an individual, all users of a role, or another action?

DepricatedZero’s picture

I'm receiving the same error.

I'm using a Rule to

When new content is saved
-and is of type X
Send email to all users of a role
-administrators

The email I receive just says "Array" - though it does populate the subject appropriately with token replacement. I'm using tokens in the body as well, but just tested and verified that this occurs without tokens too.

skanarakis’s picture

I had the same error but I was able to create the rule so that at least the functionality is fine (sending emails with attachements to all users of a role).

Of course, I still get these two warning/notice errors when I am saving a node of a specific content type (the event which triggers the rule). But at least the emails are going out correctly.

What I changed so that I get the desired functionality and not having the Array body in the email was to check the

Send plain text email only

parameter, under the MIME MAIL configuration page. If I leave it unchecked, I too get the Array body in the sent email.

In order to use tokens for my action, I used the Plaintext body section inside the action configuration page.

I hope this helps you.

sgabe’s picture

Status: Active » Fixed
FileSize
450 bytes

We need to use type text instead of text_formatted for the body field in the Send HTML email to all users of a role action also. The attached patch has been committed.

Note that you will need to clear the cache and update the rule!

skanarakis’s picture

Warning about array to string conversion is resolved with application of the patch in #8

Status: Fixed » Closed (fixed)

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

SilviuChingaru’s picture

Status: Closed (fixed) » Active

With latest dev and this patch applyed for me is not working. I'm getting the same error:

Warning: preg_match_all() expects parameter 2 to be string, array given în token_scan() (line 124 of /drupal/path/includes/token.inc).
Notice: Array to string conversion în MimeMailSystem->format() (line 24 of /drupal/path/modules/mimemail/includes/mimemail.mail.inc).
Warning: preg_match_all() expects parameter 2 to be string, array given în token_scan() (line 124 of /drupal/path/includes/token.inc).
Notice: Array to string conversion în MimeMailSystem->format() (line 24 of /drupal/path/modules/mimemail/includes/mimemail.mail.inc).
sgabe’s picture

Note that you will need to clear the cache and update the rule!

SilviuChingaru’s picture

I did that... But still same error.

sgabe’s picture

Please make sure that the change from the patch is really there and you have updated the rule settings. You need to open it for edit, set a new message in the body field and save it.

sgabe’s picture

Status: Active » Fixed

Closing due to no activity.

Status: Fixed » Closed (fixed)

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

IWasBornToWin’s picture

Was this patch committed to dev?

sisayniguasie9@gmail.com’s picture

WHAT?