CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Using Drupal Contact form
Pages: [1]

Author Topic: Using Drupal Contact form  (Read 1203 times)

markimus

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 0
Using Drupal Contact form
May 03, 2012, 12:00:53 pm
Currently I have built a view that lists a series of CiviCRM contacts.  I do not want to display the contact email address in the view but want to allow a user to click the Contact's name and then send a message to the contact through a form.  Is there an easy way to accomplish this using a webform or other? 
Success is the ability to go from one failure to another with no loss of enthusiasm.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Using Drupal Contact form
May 03, 2012, 12:29:27 pm
Hello sir. :)

Quote from: markimus on May 03, 2012, 12:00:53 pm
I do not want to display the contact email address in the view...

I second that.

Quote from: markimus on May 03, 2012, 12:00:53 pm
...but want to allow a user to click the Contact's name and then send a message to the contact through a form.  Is there an easy way to accomplish this using a webform or other?

Yes I think this can be done through webform. Perhaps it would require a hidden field of some sort, or perhaps if the URL was like sendmail/x where x is the contact ID then perhaps with a few lines of PHP code (which webform allows) you could get the email using the CiviCRM API. That's probably how you would have to do it.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

markimus

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 0
Re: Using Drupal Contact form
May 03, 2012, 12:33:56 pm
Well thank you Sir!   :D 

Not having done this type of form between drupal and civi is there a place where I can get a little assistance on building it?  OR at least some instructions? 
Success is the ability to go from one failure to another with no loss of enthusiasm.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Using Drupal Contact form
May 03, 2012, 12:43:22 pm
Offhand I don't recall the full details, but in webform there are some options for recipient email. Either it's built in or there is an add-on to be able to determine that via PHP. Using that option you could derive the contact ID using arg() or $_GET (presuming it's in the URL) and then the CiviCRM API in PHP to get the email.

This is slightly more complicated than trivial PHP I would say.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Drupal Contact form
May 03, 2012, 02:59:18 pm
you should be able to get the User id/name in views and then replace it with the 'contact' option which would do what you ask
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Using Drupal Contact form
May 04, 2012, 03:18:44 am
That would only work if every Contact has a Drupal user record. My guess is that they don't, based on the OP's question.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Drupal Contact form
May 04, 2012, 03:24:03 am
ah true - good point
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Drupal Contact form
May 05, 2012, 11:42:36 am
This would be a useful improvement to the webform_civicrm module if you'd like to sponsor this feature :)
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Using Drupal Contact form

This forum was archived on 2017-11-26.