When I try to use "mail recipient views" for selecting recipients, and then on the message use the recipient replacement pattern [manymail-recipient:field-custom] it sends all the emails it's supposed to, but it doesn't load the custom field value on the resulting email.

When I use "Mail User Roles" it works fine.

I'm on Drupal 7.15, and Views 7.x-3.3 could that be the problem ? should I add something specific on the view ? I cloned it from the example one...

Any help highly appreciated... thanks for the great module.

Comments

pipep’s picture

Category: support » bug
Priority: Normal » Critical

This is definitely a bug: custom fields aren't recognised by recipient replacement patterns.

kristiaanvandeneynde’s picture

Priority: Critical » Major

Do you mean they aren't recognized at all, or just by recipient views?

kristiaanvandeneynde’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

I tried to reproduce your error and came up with nothing.
It works fine for me, that is.

Try running the following code at yoursite.com/devel/php:

// Requires Devel module.
// Create a field on user with the machine name set to 'field_somefield'.

$tokens = array ('uid' => '[manymail-recipient:uid]', 'field_somefield' => '[manymail-recipient:field_somefield]');

$data = array('user' => user_load(1));
dpm(token_generate('user', $tokens, $data));

$data = array('manymail-recipient' => ManyMailRecipient::fromUid(1));
dpm(token_generate('manymail-recipient', $tokens, $data));

If this works, ManyMail isn't the problem but the module providing the custom fields/tokens is.