/**
  * @param SproutEmail_EntryModel    $entry
  * @param SproutEmail_CampaignModel $campaign
  *
  * @return array
  */
 public function prepareRecipientLists(SproutEmail_EntryModel $entry, SproutEmail_CampaignModel $campaign)
 {
     $ids = craft()->request->getPost('recipient.recipientLists');
     $lists = array();
     if ($ids) {
         foreach ($ids as $id) {
             $model = new SproutEmail_EntryRecipientListModel();
             $model->setAttribute('entryId', $entry->id);
             $model->setAttribute('mailer', $this->getId());
             $model->setAttribute('list', $id);
             $model->setAttribute('type', $campaign->type);
             $lists[] = $model;
         }
     }
     return $lists;
 }
 public function getRecipientListsByEntryId($id)
 {
     if ($lists = SproutEmail_EntryRecipientListRecord::model()->findAllByAttributes(array('entryId' => $id))) {
         return SproutEmail_EntryRecipientListModel::populateModels($lists);
     }
 }