Hi,
     i have set the enviornment cli in my batch script and i am
sending mail using this.

line 401      $raw_email=sfContext::getInstance()->getController()-
>dispatch('mail', 'sendCrmLead', array('param'=>'test'));
                 sfContext::getInstance()->getLogger()->debug
($raw_email);

But i am getting this error

 sfException
[message]     Call to undefined method sfRequest::getHost
[stack trace]
  at () in SF_SYMFONY_LIB_DIR/request/sfRequest.class.php line 435
  at sfRequest->__call('getHost', array()) in n/a line n/a
  at sfConsoleRequest->getHost() in SF_ROOT_DIR/apps/frontend/lib/
AgentFilter.php line 24
  at AgentFilter->execute(object('sfFilterChain')) in
SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 43
  at sfFilterChain->execute() in SF_SYMFONY_LIB_DIR/filter/
sfRenderingFilter.class.php line 33
  at sfRenderingFilter->execute(object('sfFilterChain')) in
SF_SYMFONY_LIB_DIR/filter/sfFilterChain.class.php line 43
  at sfFilterChain->execute() in SF_SYMFONY_LIB_DIR/controller/
sfController.class.php line 276
  at sfController->forward('mail', 'sendCrmLead') in
SF_SYMFONY_LIB_DIR/controller/sfConsoleController.class.php line 34
  at sfConsoleController->dispatch('mail', 'sendCrmLead', array
('param' => 'test')) in SF_ROOT_DIR/batch/crm_sync.php line 401

Thanks,
Kusum

On Mar 31, 7:26 pm, Kris <[email protected]> wrote:
> You can do it by doing something like this:
>
> sfContext::getInstance()->getController()->dispatch('myModule',
> 'myAction', array('param'=>'test'));
>
> The parameters you want to pass are an array.
>
> This way you still keep all your code in actions, and you can use
> templates you've created for your emails, all from a batch script.
>
> Kris
>
> On Mar 31, 9:21 am,kusum<[email protected]> wrote:
>
> > Hi ,
> >      how i can send email in batch script using sendEmail and set
> >   request parameter for email.
>
> >   Thanks,
> >  Kusum
> > On Mar 31, 5:18 pm,kusum<[email protected]> wrote:
>
> > > Hi ,
> > >     how i can send email in batch script using sendEmail and set
> > > request parameter for email.
>
> > > Thanks,
> > >Kusum
>
> > > On Mar 28, 7:43 pm, Kris <[email protected]> wrote:
>
> > > > Kasum,
>
> > > > Which version of Symfony are you using?
>
> > > > In your batch script, do you have:
>
> > > > define('SF_ENVIRONMENT', 'cli');
>
> > > > This setting will configure Symfony for the console instead of the
> > > > web.
>
> > > > Kris
>
> > > > On Mar 27, 4:44 am,kusum<[email protected]> wrote:
>
> > > > > Hi,
> > > > >      I am sending emails via a batch script.
>
> > > > >       I need to send parameters to the email module via request params
> > > > > or
> > > > >      attributes...
>
> > > > >   It sends the data and mail is gong proper but gives warnings like -
>
> > > > >  PHP Notice: Undefined index: REQUEST_URI in /usr/share/php/symfony/
> > > > > request/sfWebRequest.class.php on line 384
> > > > > Notice: Undefined index: REQUEST_URI in /usr/share/php/symfony/
> > > > > request/
> > > > > sfWebRequest.class.php on line 384
> > > > > PHP Notice: Undefined index: SERVER_PORT in /usr/share/php/symfony/
> > > > > request/sfWebRequest.class.php on line 406
>
> > > > > Thanks,
> > > > >Kusum
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to