sending mail in magento

前端 未结 3 1431
时光说笑
时光说笑 2021-01-01 02:23

How to send email in magento writing an action in index controller?

my index controller;

public function postAction()
{           

    $post = $this         


        
3条回答
  •  粉色の甜心
    2021-01-01 02:48

    It looks like there are a few problems with the way you are calling sendTransactional(). First off, $templateId is not defined, it looks like you've actually stored the template id in $emailId. Also, $sender, $email, and $name are undefined. You can try something like this:

    ->sendTransactional($emailId, 'general', $post['email'], "Need a send to name here")
    

    This is only going to work if you are getting a valid template id back from your call to getStoreConfig(). You'll also need to set the last name param correctly.

    There could be other issues, but that's what I noticed with a quick glance anyway.

提交回复
热议问题