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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Get This Install's Email Address
Pages: [1]

Author Topic: Get This Install's Email Address  (Read 315 times)

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Get This Install's Email Address
July 23, 2014, 01:15:15 pm
Hi CiviPeeps,

What's the best way to get the default "From" address of a given Civi install? In code, obvs.

Cheerio!
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Get This Install's Email Address
July 23, 2014, 02:42:48 pm
You can retrieve the *domain* email via API - that's the email configured at this page.

Code: [Select]
params = array(
  'version' => 3,
  'sequential' => 1,
);
$result = civicrm_api('Domain', 'get', $params);
print_r($result['values'][0]['from_email']);

I think you're asking how to get the default From email, as configured at this settings page, and I'm not sure off the top of my head how you get that information.
@xurizaemon ● www.fuzion.co.nz

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Re: Get This Install's Email Address
July 24, 2014, 11:37:03 am
Excellent! Thanks Chris!
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Get This Install's Email Address

This forum was archived on 2017-11-26.