nterms / yii2-mailqueue

Email queue component for yii2 that works with yii2-swiftmailer - https://github.com/yiisoft/yii2-swiftmailer
MIT License
85 stars 49 forks source link

Error when using aliases in view #20

Open thomassb opened 8 years ago

thomassb commented 8 years ago
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;

atakajlo commented 6 years ago

any progress?

atakajlo commented 6 years ago

to avoid this error you simply must configure viewPath parametr in mailqueue config