Hi,
I'm trying to figure out how to achieve the following:
1. I have a 'default' webform created to a custom content type (could be Webform content type, doesn't matter)
2. A user creates new content (of the custom type where webforms are also allowed from admin/config/content/webform)
3. The 'default' webform is created/attached automatically to the newly created node
I'm thinking one way could be using Rules, react on event after (or before) content saved, action would be to create the default webform and attach it to the node. Of course it could be using hooks in a custom module also.
I've been trying to search if others have done a similar thing but couldn't find anything. Any help would be appreciated, thanks!
In the end of the day I want to have a content type for announcements and each announcement would have it's own webform as a contact form to the author of the announcement. This way I could limit the number of submissions for example to avoid some of the spammers sending email to the authors.
Comments
Comment #1
wonder95 commentedI have the same issue. In my case, I have a node type called Organization that contains information for an organization (name, address, phone, email, mission statement, etc.) I need to have a contact form attached each Organization node that sends information to the email address for each organization.
Comment #2
quicksketchThis question has come up quite a few times, please use the issue search. The only project to come out of those other requests thus far is http://drupal.org/project/webform_default_fields
In the past, I've regularly suggested http://drupal.org/project/node_clone, since you can easily clone Webform nodes just like any other kind of node.
Comment #3
wonder95 commentedFWIW, I found this issue by searching through the issues. :-)
@quicksketch, I noticed that webforms can take data from GET parameters for tokens. Is it possible in my case to have one common contact form webform, and then pass parameters from the organization node to the webform, such as the recipient email address and subject?
Thanks.
Comment #4
quicksketchYes that's a very common approach. Just assemble the URL as such:
http://example.com/node/1?subject=Contact%20Us&cat=Sales(make sure it's URL encoded, for example the space is %20.)Then set up default values such as %get[subject] and %get[cat].
Comment #5
quicksketch