0

I have an entity page where the entity has an email field. On that page, there is a form built in a custom module. What I'd like to to is that on form submit, the module sends an email to the address that is the value in the entity field.

So somehow I need to pass that email address to the form submit function.

What is the best way of doing this?

  • any reasons you can not incorporate custom form as other fields in your entity form? – arpitr Jun 16 '14 at 19:55
0

One way is to put either the e-mail or an ID referencing the e-mail (the NID of the node where it is stored for example) as a hidden field, which will be received by your submit handler hook.

https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#hidden

| improve this answer | |
  • That doesn't solve the problem of getting the value of the email field into the scope of the form builder function in my custom module. – Bálint Deáki Jun 23 '14 at 6:06

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.