1

I have a content type called "Business", and a user can have multiple "Businesses".

Each business has a "business e-mail" field. This is different from the users email address, and is different for every business.

I want to be able to use VBO to send an email to all selected businesses. I have the view set up ok, and in the recipients field on the send email page I add the token....

[node:field-business-e-mail]

and I also tried...

[node:field_business_e_mail]

But I still get the error :

Enter a valid email address or use a token e-mail address such as [node:author:mail].

Is there a way to get around this?

  • 1
    I have refer to this LINK. Hope you may get your solution. – Nishant Jun 23 '15 at 6:22
  • Stick it as an answer and ill mark it – Collins Jun 23 '15 at 10:22
0

You can do this by updating code on system.module file. Below are the code :

   function system_send_email_action_validate($form, $form_state) {
       $form_values = $form_state['values'];
       $has_tokens = count(token_scan($form_values['recipient'])) > 0 ? TRUE : FALSE;
       if (!valid_email_address($form_values['recipient']) && !$has_tokens) {
          form_set_error('recipient', t('Enter a valid email address or use a token e-mail address such as %author.', array('%author' => '[node:author:mail]')));
       }
}

For any help, I have refer you to this PATCH.

This is not working directly try to do it manually.

  • This works perfectly, but unfortunately means hacking core. Do you know how i would override this in a custom module? – Collins Jun 23 '15 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.