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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Selecting Which Location to Email By
Pages: [1]

Author Topic: Selecting Which Location to Email By  (Read 534 times)

Hardwick

  • I post frequently
  • ***
  • Posts: 124
  • Karma: 1
  • CiviCRM version: 4.0.5
Selecting Which Location to Email By
February 14, 2013, 02:26:00 pm
hello, I am curious if anyone knows a way to globally configure/edit the civi system so that one can have the home email be primary so long as there is one, otherwise it would just default to the work email (everyone has one of these). Have tried everything, including batch update via profile to copy the work into a primary email field for those who only have that and so far nothing works. any help is much appreciated. H

Hardwick

  • I post frequently
  • ***
  • Posts: 124
  • Karma: 1
  • CiviCRM version: 4.0.5
Re: Selecting Which Location to Email By
February 14, 2013, 10:24:00 pm
Last best guess was to reset the default primary location then try to reimport, still no luck tho. it still keeps the home as primary, requiring me to manually reset every single dbase record to work for those with work only emails :(

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Selecting Which Location to Email By
February 18, 2013, 07:11:33 am
It's not clear to me if you're trying to make a one-time adjustment, or to automatically enforce this rule on all records moving forward.

For the first situation, you can write a short script that calls the API to set the primary e-mail correctly, or you can cheat and update the MySQL database directly (make a backup!).

For the second situation, you'll need to write a hook, though it should be relatively easy to create.  Check out hook_civicrm_post: http://wiki.civicrm.org/confluence/display/CRMDOC42/hook_civicrm_post

Jon
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Hardwick

  • I post frequently
  • ***
  • Posts: 124
  • Karma: 1
  • CiviCRM version: 4.0.5
Re: Selecting Which Location to Email By
February 18, 2013, 01:38:11 pm
Cool, thanks Jon we can definitely look into these. H

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Selecting Which Location to Email By

This forum was archived on 2017-11-26.