简体   繁体   English

Mule ESB-来自变量的SMTP主题

[英]Mule ESB - SMTP Subject from a variable

I'm working on a flow to send an attached file to a mail. 我正在研究将附件发送到邮件的流程。

<smtp:outbound-endpoint host="${instance.smtp.host}" port="${instance.smtp.port}" user="${instance.smtp.user}" password="${instance.smtp.password}" responseTimeout="10000" doc:name="SMTP" connector-ref="SMTP" from="${instance.smtp.account}"  to="${instance.smtp.user}" subject="Transaction ID #[flowVars.transactionId]"/>

Everything is working well, I already have tested my flow and the mails are arriving to the specified mail address, however, I'm trying to modify the subject dynamically, using a value stored in a variable, and then the problem appears, seems like it's not possible to use my expression to set the subject's mail. 一切工作正常,我已经测试了流程,邮件已经到达指定的邮件地址,但是,我试图使用存储在变量中的值动态修改主题,然后出现问题,似乎无法使用我的表情来设置主题的邮件。

subject="Transaction ID #[flowVars.transactionId]"

This is the error I'm getting. 这是我得到的错误。

Root Exception stack trace:

[Error: unresolvable property or identifier: Transaction] [Near : {... Transaction ID #[flowVars.tran ....}] ^ [错误:无法解析的属性或标识符:事务] [附近:{...事务ID#[flowVars.tran ....}] ^

Do you have any clue about this problem or how can I fix it? 您是否有关于此问题的线索或如何解决?

Thanks in advance. 提前致谢。

在到达SMTP消息源之前,请调试应用程序并测试是否已设置“ transactionId”的流变量。

You need to rearrange the expression so all of it is within the #[....] 您需要重新排列表达式,使其全部位于#[....]之内

subject="#['Transaction ID ' + flowVars.transactionId]"

Some fields get parsed as MEL expressions and some are more like templated strings that allow expression substitutions. 一些字段被解析为MEL表达式,而另一些字段更像是允许替换表达式的模板字符串。

(One of Mule's annoyances) (M子的烦恼之一)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM