2016-04-11 50 views
2

我想要假脱机电子邮件,我很困惑,当涉及到swiftmailer假脱机文件路径,我不知道在哪里得到一个路径?如果有人能指引我正确的方向,请提前致谢!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目录?我很困惑

编辑: 我在这里使用这个例子

swiftmailer spool file path

回答

1

第一:

#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'); 

希望它能帮助你...