Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 830237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:00:47+00:00 2026-05-15T04:00:47+00:00

I have written a reporting suite, and I have a specific report that builds

  • 0

I have written a reporting suite, and I have a specific report that builds a CSV file. Serving this file via a browser on demand isn’t an issue, but I need to be able to build this CSV file nightly, and email round a link to be able to download it.

Essentially, I need to be able to replace a specific action with a symfony task, run via cron. So how do I gain application/module context from a symfony task? And secondly, how would I invoke the SwiftMailer library from a symfony task?

I’m using symfony v1.4.4 and PHP v.5.2.13.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:00:47+00:00Added an answer on May 15, 2026 at 4:00 am

    In the configure() function of your task, you need to define the application involved in your task :

    $this->addOptions(array(
      new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name','frontend'),
      new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
      new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
    ));
    

    And then you have to create the context in the execute() function :

    sfContext::createInstance($this->configuration);
    

    Finally you can call Swift very easily :

    $this->getMailer()->composeAndSend($sender,$dest, $subject, $mailBody);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an automatic reporting and notification system written in .net that sends emails
I have written a packet reader that uses libpcap to read a capture file.
This the scenario have. There's an SSRS server that has a report where the
We have an application that is written in .NET 3.5. This app works on
I have written this OSGI bundle: /* * To change this template, choose Tools
I have written a module that uses vqmod for opencart. How can I check
I have written a web application that uses Microsoft's built-in membership authentication that is
I have written a Perl script that runs as a daily crontab job that
I have one user reporting this exception. My research here and elsewhere suggests this
Question: I have written a console program that uses the SQL server 2005 web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.