Adobe CQ5 - 自定义邮件功能

发布于 2025-01-07 14:21:13 字数 215 浏览 1 评论 0原文

我对 Adob​​e CQ5 有要求。我必须创建一个包含某些字段的表单(例如注册表单)。现在,创建表格后,我必须将详细信息邮寄到特定的电子邮件。我需要知道的是。

  1. 如何创建自定义电子邮件模板?
  2. 现在使用模板如何使用通过表单捕获的数据创建电子邮件?
  3. 如何配置电子邮件设置?

请提供您对此的想法。可能对很多人有帮助。 提前致谢。

I have a requirement in Adobe CQ5. I have to create a form with some fields (say a registration form). Now after creating the form I have to mail the details to a particular email. things I need to know are.

  1. How to create custom email template?
  2. Now using the template to how do I create email with the data captured via form?
  3. How to configure the email settings?

Please provide you thoughts on this. Might be helpful to a lot of people.
Thanks in Advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡淡の花香 2025-01-14 14:21:13
  1. 您可以使用表单上的隐藏字段来发送消息正文以及其余字段。您还可以使用 CQ 表单组件来完成此操作。

  2. 在这里您可以做两件事,一是扩展 Foundation 中 src 文件夹中的 mailServlet 类,这是使用 Foundation 邮件操作的类,然后您扩展或创建一个自定义操作以将其与 CQ 一起使用表单组件,或者您可以使用 MailService 类实现 servlet。

  3. 使用CQ邮件服务的邮件设置可以在配置面板的Felix控制台上进行设置,搜索CQ5邮件服务来设置smtp服务器、凭据和端口。

  1. You could use hidden fields on the form to send the body of the message with the rest of the fields. You can also do it with the CQ form components.

  2. Here you could do 2 things, one is extending the mailServlet class that is on the src folder in foundation, this is the one that uses the foundation mail action, then you extend or create a custom action for use it with the CQ Form components, or you can implement a servlet with the MailService class.

  3. the mail setting using the CQ mail service can be set on the Felix console on the configuration panel, search for the CQ5 Mail Service to set the smtp server, credentials and ports.

2025-01-14 14:21:13

我通过使用工作流程发送表单数据来满足类似的要求。这一切都可以使用 cq 中的开箱即用组件来完成。

1.
电子邮件模板的示例可以在 /etc/workflow/geometrixx/email/workflow.txt 中找到。

From: Geometrixx Admin <[email protected]>
To: ${payload.email}
BCC: [email protected]
Subject: Signup for ${payload.fullname}

Dear ${payload.fullname}

Please find your account here: http://www.day.com/
Your password is: ${payload.temppassword}

regards
Geometrixx Team

您可以将电子邮件中的静态文本与表单中的动态值混合在一起。您可以使用表单中的任何字段的 ID 来访问该字段。例如,要获取 id=comments 的字段内容,您可以在模板中使用 ${payload.comments}。

2.
构建模板后,您可以将其链接到与表单关联的工作流程。构建工作流时要使用的工作流组件称为“流程步骤”。在该组件编辑对话框的流程选项卡中,有一个下拉菜单。从该列表中选择发送电子邮件。在参数字段中,只需添加电子邮件模板的路径即可。如果您现在测试该表单,您应该会收到一封电子邮件,其中包含您想要的任何表单数据。

3.
AJ Olivia 是正确的,邮件服务可以在 felix 控制台中设置。可以在这里找到:HOST:PORT/system/console/configMgr/com.day.cq.mailer.DefaultMailService

I've had similar requirements that I met by using a workflow to send the form data. This can all be done using out of the box components from cq.

1.
An example of an email template can be found at /etc/workflow/geometrixx/email/workflow.txt.

From: Geometrixx Admin <[email protected]>
To: ${payload.email}
BCC: [email protected]
Subject: Signup for ${payload.fullname}

Dear ${payload.fullname}

Please find your account here: http://www.day.com/
Your password is: ${payload.temppassword}

regards
Geometrixx Team

You can mix static text in the email with dynamic values from the form. You can access any field in the form by using it's ID. For example, to get a field's contents with id=comments you would use ${payload.comments} in the template.

2.
Once you have the template built, you can link it to the workflow you have tied to the form. The workflow component you will want to use when building the workflow is called Process Step. In the process tab of that components edit dialog there is drop down. Choose send email from that list. In the arguments field, just add the path to your email template. If you test the form now, you should be receive an email containing whatever form data you wanted.

3.
AJ Olivia was correct in that the mail service can be set in the felix console. It can be found here: HOST:PORT/system/console/configMgr/com.day.cq.mailer.DefaultMailService

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文