public function register()
 {
     $this->app->singleton(Newsletter::class, function () {
         $getResponse = new \GetResponse(config('laravel-newsletter-getresponse.apiKey'));
         $configuredLists = NewsletterListCollection::createFromConfig(config('laravel-newsletter-getresponse'));
         return new Newsletter($getResponse, $configuredLists);
     });
     $this->app->alias(Newsletter::class, 'laravel-newsletter-getresponse');
 }
 /**
  * @param string $fromName
  * @param string $replyTo
  * @param string $subject
  * @param string $html
  * @param string $listName
  * @param array  $options
  * @param array  $contentOptions
  *
  * @return array|bool
  *
  * @throws \Bonsi\GetResponse\Newsletter\Exceptions\InvalidNewsletterList
  */
 public function createCampaign($fromName, $replyTo, $subject, $html = '', $listName = '', $options = [], $contentOptions = [])
 {
     $list = $this->lists->findByName($listName);
     $defaultOptions = ['type' => 'regular', 'recipients' => ['list_id' => $list->getId()], 'settings' => ['subject_line' => $subject, 'from_name' => $fromName, 'reply_to' => $replyTo]];
     $options = array_merge($defaultOptions, $options);
     $response = $this->getResponse->post('campaigns', $options);
     if (!$this->lastActionSucceeded()) {
         return false;
     }
     if ($html === '') {
         return $response;
     }
     if (!$this->updateContent($response['id'], $html, $contentOptions)) {
         return false;
     }
     return $response;
 }