Mission: use MailJet transaction service
Problem: Yii2 always wants to instantiate the SwiftMailer instead.
Advanced app template, common config:
['components']
// MailJet vendor/weluse and vendor mailjet
'mailer' => [
'class' => 'common\modules\jet\Mailer',
'apikey' => '',
'secret' => '',
'useFileTransport' => true,
'viewPath' => '@common/mail',
Composer:
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.6",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"mdmsoft/yii2-admin": "~2.0",
"guzzlehttp/guzzle": "^6.2",
"mailjet/mailjet-apiv3-php": "^1.1",
"kartik-v/yii2-slider": "dev-master",
"kartik-v/yii2-widget-colorinput": "*",
"weluse/yii2-mailjet": "^0.1.1"
},
Error
Setting unknown property: yii\swiftmailer\Mailer::apikey
Initial testing with the weluse mailejt component worked.
Then I found issues with the weluse mailjet component, I copied into my own namespace to make it my own.
When I change the name from ‘mailer’ to ‘mailjet’ then \Yii->$app->mailjet->compose() etc works.
So I do not think I have broken the component.
But I have switched from basic to advanced template.
I have scoured the configs for ‘yii\swiftmailer\Mailer’, the only place I find it active is in yii/base Application::coreComponents()
I commented that out just to see, and it made no difference?
I’ve done something funky. Anyone recognize the issue? Thank you.