0

I try to add mail subject in my custom mail, but i can't find anything about this.

My code for sending emails looks like this:

$from = array('email' => "[email protected]", 'name' => 'info');
$this->inlineTranslation->suspend();
$transport = $this->_transportBuilder->setTemplateIdentifier('medipoint_template_lend')
    ->setTemplateVars(['data' => $postObject])
    ->setFrom($from)
     ->addTo($to)
    ->getTransport();
$transport->sendMessage();
$this->inlineTranslation->resume();

Does anyone know how to add subject to maill?

1 Answer 1

0

Usually you have to use an email template. The subject is then defined inside that template using something as such

<!--@subject Subject Of your email  @-->

In our module we used a helper to get the custom template and send the email.

2
  • so i just need to add <!--@subject [subject] @--> at the begining of email template? Mar 8, 2017 at 11:37
  • i did this but nothing happen Mar 8, 2017 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.