/**
     * Create long task for generating of mails
     * @param $form
     * @param $dbTemplate
     * @return Pap_Mail_GenerateMassMailsTask
     */
    protected function createLongTask(Gpf_Rpc_Form $form, Gpf_Db_MailTemplate $dbTemplate, $recipientsList) {
        $sender = '';
        if($form->getFieldValue('from') == "affEmail") {
            $sender = Gpf_Session::getAuthUser()->getUsername();
        }

        $task = new Pap_Mail_GenerateMassMailsTask();
        $task->setMassMailParams($dbTemplate->getId(), 'custom', implode(",",$recipientsList),gpf_session::getAuthUser()->getUserId(), self::PURPOSE_SEND_TO_FRIEND, $sender);
        return $task;
    }
 /**
  * Create long task for generating of mails
  * @param $form
  * @param $dbTemplate
  * @return Pap_Mail_GenerateMassMailsTask
  */
 protected function createLongTask(Gpf_Rpc_Form $form, Gpf_Db_MailTemplate $dbTemplate) {
     $task = new Pap_Mail_GenerateMassMailsTask();
     $affiliateId = null;
     if(Gpf_Session::getRoleType() == 'A'){ 
         $form->setField('affiliatesFilter','custom');
         $form->setField('includeCustomMails','');
         $affiliateId = Gpf_Session::getAuthUser()->getUserId();
     }
     $task->setMassMailParams($dbTemplate->getId(), $form->getFieldValue('affiliatesFilter'), $form->getFieldValue('includeCustomMails'), $affiliateId);
     return $task;
 }
 /**
  * Create long task for generating of mails
  * @param $form
  * @param $dbTemplate
  * @return Pap_Mail_GenerateMassMailsTask
  */
 private function createLongTask(Gpf_Rpc_Form $form, Gpf_Db_MailTemplate $dbTemplate)
 {
     $task = new Pap_Mail_GenerateMassMailsTask();
     $task->setMassMailParams($dbTemplate->getId(), $form->getFieldValue('affiliatesFilter'), $form->getFieldValue('includeCustomMails'));
     return $task;
 }