swiftmailer 假脱机文件路径
swiftmailer spool file path
我正在尝试假脱机处理电子邮件,当涉及到 swiftmailer
假脱机文件路径时我感到困惑,我不确定从哪里获得路径?如果有人能指出我正确的方向,在此先感谢!
因为当我尝试 运行 这个命令时,
php app/console swiftmailer:spool:clear-failures --env=prod
它给我这个错误
"The parameter "swiftmailer.spool.file.path" must be defined"
//要做什么把路径放在这里
$spoolPath = $this->getContainer()->getParameter('swiftmailer.spool.file.path');
我在这里称呼它吗?
# app/config/config.yml
swiftmailer:
# ...
spool:
type: file
path: /path/to/spooldir
如何在我的文件夹中找到这个 /path/to/spooldir
目录?我很困惑
编辑:
我在这里使用这个例子
第一个:
#app/config/config.yml
swiftmailer:
#...
spool:
type: file
path: "%mailer_spool_path%"
第二个:
#app/config/parameters.yml
parameters:
#...
mailer_spool_path: '%kernel.root_dir%/spool'
您将可以通过以下方式访问此参数(在命令中):
$spoolPath = $this->getContainer()->getParameter('mailer_spool_path');
希望对您有所帮助...
我正在尝试假脱机处理电子邮件,当涉及到 swiftmailer
假脱机文件路径时我感到困惑,我不确定从哪里获得路径?如果有人能指出我正确的方向,在此先感谢!
因为当我尝试 运行 这个命令时,
php app/console swiftmailer:spool:clear-failures --env=prod
它给我这个错误
"The parameter "swiftmailer.spool.file.path" must be defined"
//要做什么把路径放在这里
$spoolPath = $this->getContainer()->getParameter('swiftmailer.spool.file.path');
我在这里称呼它吗?
# app/config/config.yml
swiftmailer:
# ...
spool:
type: file
path: /path/to/spooldir
如何在我的文件夹中找到这个 /path/to/spooldir
目录?我很困惑
编辑: 我在这里使用这个例子
第一个:
#app/config/config.yml
swiftmailer:
#...
spool:
type: file
path: "%mailer_spool_path%"
第二个:
#app/config/parameters.yml
parameters:
#...
mailer_spool_path: '%kernel.root_dir%/spool'
您将可以通过以下方式访问此参数(在命令中):
$spoolPath = $this->getContainer()->getParameter('mailer_spool_path');
希望对您有所帮助...