Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By piridium on
I want to appended a registration form to a node-type. So far, I am able to append a form like this:
- Create a new form: /admin/structure/contact
- Add a new field to the content type:
Field type: 'Reference - other...'
Choose 'contact form' in the second step. - Change 'label' to 'rendered entity' in 'manage display' settings.
This works as expected. However, I want to send the form to the author of the node - not a predefined recipient in the form settings. Additionally, I need to include a link to the node from which the form has been sent.
Any ideas?
Comments
=-=
investigate the rules module for sending to author
investigate a custom tpl.php for the form with your logic to print a link if rules doesn't already cover it
will check
Thanks VM. I will check if rules is of any help. I don't know it very well yet and I got the impression it's a pretty mighty but complicated module.
Regarding tpl.php, please note that the question was asked for D8. I don't think I can add this functionality in a twig-template.
I already tried it with a custom module and hook_mail_alter. I can change the 'to' there, but have no idea how to get the mail-adress of the node author. Any hints are highly welcome. :-)
The client decided for
The client decided for another solution for registration which is far more easy to implement. Thanks anyway!