You are here

function _simplenews_init_default_newsletter in Simplenews 7.2

1 call to _simplenews_init_default_newsletter()
simplenews_install in ./simplenews.install
Implements hook_install().

File

./simplenews.install, line 367
Install, update and uninstall functions for the simplenews module

Code

function _simplenews_init_default_newsletter() {
  $newsletter = simplenews_newsletter_get_all();
  if (is_array($newsletter)) {
    $newsletter = reset($newsletter);
  }
  if (!$newsletter) {
    $newsletter = entity_create('simplenews_newsletter', array(
      'name' => t('@site_name newsletter', array(
        '@site_name' => variable_get('site_name', 'Drupal'),
      )),
    ));
    $newsletter
      ->save();
  }
}