Skip to content

Error when using aliases in view #20

@thomassb

Description

@thomassb
return Yii::$app->mailqueue->compose("@frontend/views/emails/newJob", [
                        'name' => $job->FullName,
                        'email' => $job->Email,
                        'address' => $job->FullAddressHtml,
                        'price' => $job->price,
                        'url' => Yii::$app->urlManager->createAbsoluteUrl(['job/review', 'url' => $job->url]) 
                    ])
                    ->setFrom(\Yii::$app->params['fromEmail'])
                    ->setTo($job->Email)
                    ->setSubject('New Order')
                    ->queue();

gives errror
The view file does not exist: /var/www/xx/frontend/mail/layouts/html.php

This works correctly when using the swiftmailer directly.
At the moment I am added this to the compose function
$this->htmlLayout = "@common/mail/". $this->htmlLayout;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions