Search code examples
prestashop

How to Send email programatically Prestashop?


Hello i am trying to send email in prestashop in module but its not working.

Is their any way to do this ?


Solution

  • You should check Mail class and Send method.

    Example:

    Mail::Send(
        (int) $this->context->language->id,
        $this->getTemplate(),
        $this->getSubject(),
        $this->getTemplateVars(),
        $this->getTo(),
        $this->getToName(),
        $this->getFrom(),
        $this->getFromName(),
        $this->getFileAttachment(),
        $this->isModeSmtp(),
        $this->getTemplatePath(),
        $this->isDie(),
        (int) $this->context->shop->id,
        $this->getBcc(),
        $this->getReplyTo()
    );
    

    You have more examples in entire system. Just search for "Mail::Send" in code.