Hi,
I will send a email in a controller, but receive :
Call to undefined method Espo\\Custom\\Controllers\\Contact::getMailSender( ) at custom/Espo/Custom/Controllers/Contact.php
It's certainly easy .. but I lag
Regards
I will send a email in a controller, but receive :
Call to undefined method Espo\\Custom\\Controllers\\Contact::getMailSender( ) at custom/Espo/Custom/Controllers/Contact.php
It's certainly easy .. but I lag
Regards
PHP Code:
namespace Espo\Custom\Controllers;
use \Espo\ORM\Entity;
use \Espo\Entities;
use \Espo\Core\Utils\Util;
use \Espo\Entities\Email;
class Contact extends \Espo\Core\Templates\Controllers\Person
{
$email = $this->getEntityManager()->getEntity('Email');
$email->set([
'to' => 'to@mailsender.net',
'subject' => 'subject',
'body' => 'body',
'isHtml' => false
]);
$this->getMailSender()->send($email);
return true;
}
Comment