Jump to content

Edit History

Andrei H

Andrei H

Hello,

The below code should do the trick for you:

if ($template === 'order_conf') {
    $message->attach(
        (new Swift_Attachment())->setFilename('CGV.pdf')
            ->setContentType('application/pdf')
            ->setBody(file_get_contents(__DIR__ . '/CGV.pdf'))
    );
}

The attached screenshot highlights where the code should be placed. 

Let me know if it works for you.

PS: This will pick up the CGV.pdf file from the current directory (classes)

Screenshot 2024-08-01 212756.png

Andrei H

Andrei H

Hello,

The below code should do the trick for you:

if ($template === 'order_conf') {
    $message->attach(
        (new Swift_Attachment())->setFilename('CGV.pdf')
            ->setContentType('application/pdf')
            ->setBody(file_get_contents(__DIR__ . '/CGV.pdf'))
    );
}

The attached screenshot highlights where the code should be placed. 

Let me know if it works for you.

 

PS: This will pick up the CGV.pdf file from the current directory (classes)

Screenshot 2024-08-01 212756.png

Andrei H

Andrei H

Hello,

The below code should do the trick for you:

if ($template === 'order_conf') {
    $message->attach(
        (new Swift_Attachment())->setFilename('CGV.pdf')
            ->setContentType('application/pdf')
            ->setBody(file_get_contents(__DIR__ . '/CGV.pdf'))
    );
}

The attached screenshot highlights where the code should be placed. 

Let me know if it works for you.

Screenshot 2024-08-01 212604.png

×
×
  • Create New...