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' => "info@info.nl", '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?

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.

| improve this answer | |
  • so i just need to add <!--@subject [subject] @--> at the begining of email template? – Alin Lupoiu Mar 8 '17 at 11:37
  • i did this but nothing happen – Alin Lupoiu Mar 8 '17 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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