Email to node author in Drupal 7 - drupal

Drupal 7:
I need a module to append a contact form to a node of a specific content type. The form should be configurable and permit to send an email with an attachment to the node author. The form should also have a captcha. The email must not be saved in the database.
Does such module exists or do i need to develop it ?

You should be able to achieve this through the combination of the webform module, CAPTCHA module and a custom module.
Webform defines it's own 'webform' content type, but it also allows you to make other content types webform enabled by visiting 'admin/config/content/webform' and selecting the appropriate content type.
The token module provides node tokens such as nid and title which can be included as a hidden form element, but annoyingly, doesn't include the author as a token.
On the email tab of your webform, it's possible to choose a form component as the email address to send the form results to. I would create a hidden field, leaving the default value blank and then it should be fairly easy to add the node author value to it in a custom module using hook_form_alter (form id can be found by viewing source and looking for the hidden input 'form_id'). You can then use this form component in the email tab to send the results to.
The only thing I can see causing an issue is that there isn't an easy way to stop webform recording the form result in the database - I would imagine this would be achievable in a custom module without too much hassle though.

Yop, there is such a module. It's called Webform. Using Webform you can add a block form under certain node type with predefined fields and let send email directly to the node author.
Download and enable Webform 4.x
Create new from, add desired fields
Under E-mails tab for Address use token [current-page:node:author:mail]
In Form settings tab check Available as block
Configure newly enabled block (show only under certain node type + set restricted pages to the node/*/*)
Do tests
You can find printcreens and more detailed instructions here.

Related

Add Favourites to create a list then email list as part of an enquiry form

I have a client that wants a property directory, but they want users to be able to favourite multiple properties - then view their favourite properties on separate page - then send all those properties to a single email address as part of an enquiry.
cannot see how to do this using agentpress framework
You have two options, the first is to save as properties in session. The second if users are logged in to Wordpress is to use admin-ajax to add the properties as a meta data of the user. So this way you can access these meta infos using get_user_meta();
Documentation:
https://codex.wordpress.org/Function_Reference/get_user_meta
https://codex.wordpress.org/Function_Reference/add_user_meta
https://codex.wordpress.org/Function_Reference/update_user_meta

wordpress register form to salesforce

I'm wondering if it's possible to use a saleforce form for registering users on wordpress so that when a user registers on the frontend their details are sent to saleforce CRM?
The answer would vary depending on what form tool, if any, you're using, but lately I've been using Gravity Forms and have had great success with connecting to Salesforce via a custom Gravity forms redirect confirmation.
Once you have a form built in Gravity Forms, go to Form Settings > Confirmations. Edit the default Confirmation and change to Type "Redirect". You'll want to post the form to Salesforce's Web-To-Lead API, so enter https://www.salesforce.com/servlet/servlet.WebToLead in the Redirect URL field.
You'll then pass the fields you need via a query string, so check the 'Pass Field Data Via Query String' box, then configure the query string with Salesforce field names and Gravity forms merge tags. There are a couple required parameters including the encoding, your Salesforce Company ID, and a return URL to redirect back to after the form is submitted.
Leave off the ? to begin the query string, so it looks like
encoding=UTF-8&oid=0123456789&retURL=http://example.com
then add fields such as first name, last name, company, country, etc. by adding a parameter for each and selecting the appropriate Gravity Form merge tag from the menu on the right. It will end up looking something like
&first_name={First Name:1}&last_name={Last Name:2}&company={Company:3}
You can also send data to custom fields in Salesforce if you find the field ID. The easiest way to do this is by creating a Web-to-lead form in Salesforce and copying the field's name.
All together, your confirmation should look something like this -
For bonus points, you could add a hidden field to the form for the Return URL and populate it dynamically on the page, either by pulling the current page URL, or adding a custom field to choose a Return URL dynamically.
If you're not using Gravity Forms, you can still use Salesforce's Web-To-Lead tool by creating your own form, or using theirs, and sending the data in a query string.
There are various plugins that allow you to send data to Salesforce from a form, such as WordPress-to-lead for Salesforce CRM.
It is also possible to use the Salesforce API to build a single signon, and register users to or from either service. I built one for SugarCRM, which you can view the code for it at Github to get an idea of how it might work with Salesforce.

Prepopulate Content Type Args when going to /admin/content in Drupal 7

I created a Drupal site. The admins who will be using the site for content management have no Drupal knowledge and I have been tasked with making this as easy as possible for them. I'm creating an admin control panel and I want a quick link that takes them to the admin content page, but with the "content type" prefilled. For example, for content I have pages, events, resources, and testimonials. I want to provide them with a quick link for editing content type EVENTS only. So it would go directly to admin/content with the type filter set to "events". The URL does not currently add args or anything like that.
Anyone know of a way to do this?
yes you can do this- just use this module: Drupal admin views which supports a REGULAR VIEW for admin/content. The View is set to use ajax though- just remove this option and save it and call /admin/content then. There you will see the resulting filters in the URL (you can even set their keys to a value you like inside the view). Set back to use ajax (if you like) and use the keys in the URL for type it's simple just call /admin/content?type=YOURTYPE

In drupal 7, get a taxonomy token replaced in a panelizer webform

Here's my scenario: I have a drupal 7 site. It's categorized by a taxonomy. Each taxonomy term is panelized to display its main page. For each of those pages, I want to add a webform that would allow the visitor to email the person responsible for that area. The responsible person is defined in a hidden field on the taxonomy term.
If I add custom content to the panelizer page with the token
%taxonomy_term:field-generic-email-address
the email address is displayed. However, I need to get that into the webform, and I can't get it to pull the value from the token - it just displays that exact text (I'm trying to add it to a hidden field, but I'm sticking it into the body just to see, and in either place, it shows the token text instead of replacing it with the email). Does anyone know how to do this?
You might want to check out a module called EntityForm https://drupal.org/project/entityform
It allows you to use regular Drupal fields to build a user-submittable form.
There are other ways to do this, but this method may allow you to get what you want and more.

Drupal 6.x Add More Module - No end to adding more

Simple question for all of you here dealing with Drupal 6.x...
With Drupal's Add More module, is there a way to configure my webform so that there is no limit on how many of a specific fields I can add more of?
Please see my image for example:
For example, I'd like to enable the user to add as many titles as they would like. Is that doable?
Unfortunately, it's not currently possible to add unlimited "add another" functionality with webforms. And if this functionality does become a reality someday, I doubt it will be backported to the Drupal 6 version of the module. From the webform modules author (quicksketch):
there is no progress on this subject. The ability to support multiple
values requires a tremendous amount of re-architecting, including
changes to the way CSVs are generated, analysis, the database
structure, and the UI (both for administrators and users). I wouldn't
expect this feature to be added any time soon.
See this thread for more information:
http://drupal.org/node/354381
I would suggest using a node and the CCK module plus rules and views to collect this information.
Assumptions:
Anonymous users can fill out the current form
You need some way of retrieving the data that is submitted
Regular users of the site should not be able to view submissions
Very loose directions:
Create a content type and add all of the fields that your current webform contains to it. CCK has the ability to store unlimited values out of the box. On the field settings page, inside the Global Settings fieldset, select "Unlimited" for the "Number of Values" field.
Give anonymous users permission to Create [your-new-content-type] Content on the Role Permissions page.
Using the Rules module, create a new triggered rule that fires on "Content is about to be viewed" with an condition "Content has type [your-new-content-type]" and an action of redirect to homepage (or a custom error page that you created). (Note: this is a bit of a performance hit. There are better ways to restrict access to this content type, but for the sake of this tutorial, this was the easiest to explain)
Using the Views module, create a new view with Style set to Table. Add each of the fields in [your-new-content-type] in the fields section. Under "Access" choose "role" and select the role that is assigned to your user. Add a "page" display, give it a Path and save. This is the page you will use to view submissions.
Optional:
Use the Rules module to send yourself (or the submitter) an email when a node of [your-new-content-type] is created.

Resources