Giter Site home page Giter Site logo

Comments (5)

dereuromark avatar dereuromark commented on June 27, 2024

You will have to properly initialize an Emali task, including the settings (where to, ...). See the test cases maybe.

from cakephp-queue.

jaychakra avatar jaychakra commented on June 27, 2024

I have initialized the task like this

$this->loadModel('Queue.QueuedTask');
$this->QueuedTask->createJob(
            'Email', array(
                'domain'=>'mydomain.com',
                'to' => '[email protected]',
                'from'=>array('[email protected]' => 'Name'),
                'subject'=>'Test'
            )
       );

Am I missing something??

from cakephp-queue.

dereuromark avatar dereuromark commented on June 27, 2024

You did not look into the test cases as I told you, did you? ;)
They clearly state how it should be done or how it is expected (if you don't want to look in the source code directly, where it also points to the solution):

    $data = [
        'settings' => [
            'subject' =>...,
            'to' => ...,
            'domain' => 'example.org',
        ],
        'vars' => [
            'content' => 'I am a test',
        ]
    ];

    if ($this->QueuedTask->createJob('Email', $data)) { ... }

from cakephp-queue.

jaychakra avatar jaychakra commented on June 27, 2024

Sorry for the earlier mistake.

I have made the above changes but there is still an error regarding unavailability of tools.

Running Job of type "Email"
Error: Plugin Tools could not be found.
#0 /home/gloryque/public_html/quarc/lib/Cake/Core/App.php(227): CakePlugin::path('Tools')
#1 /home/gloryque/public_html/quarc/lib/Cake/Core/App.php(549): App::path('Lib', 'Tools')
#2 [internal function]: App::load('EmailLib')
#3 /home/gloryque/public_html/quarc/app/Plugin/Queue/Console/Command/Task/QueueEmailTask.php(104): spl_autoload_call('EmailLib')
#4 /home/gloryque/public_html/quarc/app/Plugin/Queue/Console/Command/QueueShell.php(221): QueueEmailTask->run(Array, '28')
#5 /home/gloryque/public_html/quarc/lib/Cake/Console/Shell.php(445): QueueShell->runworker()
#6 /home/gloryque/public_html/quarc/lib/Cake/Console/ShellDispatcher.php(209): Shell->runCommand('runworker', Array)
#7 /home/gloryque/public_html/quarc/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch()
#8 /home/gloryque/public_html/quarc/app/Console/cake.php(47): ShellDispatcher::run(Array)
#9 {main}

from cakephp-queue.

dereuromark avatar dereuromark commented on June 27, 2024

That is also documented (and visible in the code).
This task uses and requires the Tools plugin.
Write your own Email task to use the Cake core email lib if that's what you want.

from cakephp-queue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.