You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement the bundle to use Mandrill, but I am getting the following error
The definition "my_project.mailer.mailer" has a reference to an abstract definition "hb_stampie.mailer.mandrill". Abstract definitions cannot be the target of references.
And my service MyProject\MailerBundle\Mailer\Mailer goes like this (I put only the constructor function)
namespace MyProject\MailerBundle\Mailer;
use MyProject\WebBundle\Entity\Member;
use Stampie\Identity;
use Stampie\MailerInterface as StampieMailerInterface;
class Mailer implements MailerInterface
{
private $mailer;
private $twig;
private $defaultSenderName;
private $deployInstance;
/**
* @param StampieMailerInterface $mailer
* @param \Twig_Environment $twig
* @param string $defaultSenderName
* @param string $deployInstance
*/
public function __construct(StampieMailerInterface $mailer, \Twig_Environment $twig, $defaultSenderName, $deployInstance)
{
$this->mailer = $mailer;
$this->twig = $twig;
$this->defaultSenderName = $defaultSenderName;
$this->deployInstance = $deployInstance;
}
}
My MailerInterface (implemented by MyProject\MailerBundle\Mailer\Mailer) is simply the following:
namespace MyProject\MailerBundle\Mailer;
interface MailerInterface
{
/**
* Sends a mail to the recipient(s) using the template.
*
* The template must define 3 blocks: subject, body_text and body_html.
*
* @param Message $message
*/
public function send(Message $message);
}
Now if I look in the config.xml of the henrikbjorn bundle, I do have <service id="hb_stampie.mailer.mandrill" class="%hb_stampie.mailer.mandrill.class%" abstract="true" />
which means that the hb_stampie.mailer.mandrill is an abstract class.
What am I missing in the configuration here? What should I do to be able to use Mandrill to send my mails?
The text was updated successfully, but these errors were encountered:
the service you should inject is hb_stampie.mailer, which is the mailer configured in the bundle. hb_stampie.mailer.mandrill is an internal abstract service, not something meant to be used (and it will even probably disappear in the next version of the bundle).
Btw, this issue is related to the bundle, not to Stampie itself.
Hello everyone.
I am trying to implement the bundle to use Mandrill, but I am getting the following error
The definition "my_project.mailer.mailer" has a reference to an abstract definition "hb_stampie.mailer.mandrill". Abstract definitions cannot be the target of references.
I have a mailers.yml where I define my services:
My config.yml goes like this:
And my service
MyProject\MailerBundle\Mailer\Mailer
goes like this (I put only the constructor function)My MailerInterface (implemented by
MyProject\MailerBundle\Mailer\Mailer
) is simply the following:Now if I look in the config.xml of the henrikbjorn bundle, I do have
<service id="hb_stampie.mailer.mandrill" class="%hb_stampie.mailer.mandrill.class%" abstract="true" />
which means that the
hb_stampie.mailer.mandrill
is an abstract class.What am I missing in the configuration here? What should I do to be able to use Mandrill to send my mails?
The text was updated successfully, but these errors were encountered: