power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Problems calling TEmail from Command Line #360

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Create a php function with the code:

include("/www/SITE/framework_3.1.10/prado.php");
$application=new TShellApplication(dirname(__FILE__).'/application.xml');
$application->run();

$mail = new TEmail();

$subject = "subject";
$contentHTML = "<h1>This is a test</h1>";
$mail->setSubject($subject);                
$mail->getEmailAddresses()->add('Sender', "test@test.com", "Carlos Test");
$mail->getEmailAddresses()->add('Reciever', "carlos@test.com", "Carlos name");
$mail->setHTMLContent($contentHTML);

2. Try to call the function from the command line (in a linux box it will be 
php yourFunction.php)

What is the expected output? What do you see instead?

As the mail is not sent, the expected output is nothing, but I get this error:

PHP Fatal error:  Call to a member function getRequestedPage() on a non-object 
in /www/SITE/framework_3.1.10/Web/UI/TTemplateManager.php on line 314
PHP Stack trace:
PHP   1. {main}() /www/SITE/protected/exeCronTask.php:0
PHP   2. TEmail->setHtmlContent() /www/SITE/protected/exefunction.php:36
PHP   3. TControl->ensureChildControls() 
/www/SITE/framework_3.1.10/Util/TEmail.php:49
PHP   4. TTemplateControl->createChildControls() 
/www/SITE/framework_3.1.10/Web/UI/TControl.php:918
PHP   5. TTemplate->instantiateIn() 
/www/SITE/framework_3.1.10/Web/UI/TTemplateControl.php:141

What version of the product are you using? On what operating system?

Prado 3.1.10_r3017

Original issue reported on code.google.com by cmcam...@gmail.com on 18 Aug 2011 at 9:30

GoogleCodeExporter commented 8 years ago
Prado doesn't ship a TEmail control, so you probably downloaded it from 
somewhere and installed it manually.
So we can't really fix it since it's not part of prado. Maybe after making it 
work it would be a nice addition.
Anyway, the issue seems related to the face that TEmail seems to be a 
TTemplateControl that requires a TPage to work, while TShellApplication doesn't 
create any TPageService (and so no TPage is available to controls).
I guess a "send email" control like TEmail doesn't really need a template file.

Original comment by ctrlal...@gmail.com on 19 Aug 2011 at 1:40

GoogleCodeExporter commented 8 years ago
You are absolutely right. I took the TEmail control from the forum:

http://www.pradoframework.com/forum/index.php?topic=7884.0

I am really sorry for the inconvenience. I'll try to get more help in the forum 
as it's not a Bug related to Prado.

Thank you very much for your assitance.

Original comment by cmcam...@gmail.com on 19 Aug 2011 at 1:48

GoogleCodeExporter commented 8 years ago
Hello, I think that this Issue should close, beacuse could confused to users.

Thanks,

Original comment by jaimea.g...@gmail.com on 23 Sep 2011 at 4:20

GoogleCodeExporter commented 8 years ago

Original comment by ctrlal...@gmail.com on 24 Sep 2011 at 11:22