cancel
Showing results for 
Search instead for 
Did you mean: 

custom module - send email

SOLVED

Re: custom module - send email

@agiorgini

 

Hello

 

 $transport->setTemplateVars(['data' => 'nonprende'])
                ->setFrom($senderInfo)
                ->addTo($receiverInfo);
$transport = $transport->getTransport();
$transport->sendMessage();  

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: custom module - send email

Thanks you so much Sunil, that solved.

Would u be so nice to explain what's the difference between:

 

            $transport->setTemplateVars(['data' => 'nonprende'])
                ->setFrom($senderInfo)
                ->addTo($receiverInfo)
                ->getTransport();
            $transport->sendMessage();

and:

 

$transport->setTemplateVars(['data' => 'nonprende'])
                ->setFrom($senderInfo)
                ->addTo($receiverInfo);
            $transport = $transport->getTransport();
            $transport->sendMessage();

thanks a lot