健康计划处方电子邮件 plan-prescription

个人资料包含健康计划,每个计划都包含处方。 处方具有各种状态,如“准备就绪”、“召回”或“已接受”。

在此使用案例中,我们希望向每个用户档案发送一封电子邮件,其中包括准备好接收或撤回的所有处方。 单击下面的每个选项卡,以了解有关用于实施此用例的语法的更多信息。

已呈现消息

嗨,John,Doe

以下是已准备好取药或已被召回的处方:

健康计划A

  • 处方ID: pres1
    名称: 药物A
    状态: 就绪
  • 处方ID: pres2
    名称: 药物B
    状态: 撤消

健康计划B

  • 处方ID: pres4
    名称: 药物D
    状态: 就绪
HTML模板
code language-html
<p>Hi {{profile.person.firstName}} {{profile.person.lastName}},</p>
<p>Here are the prescriptions that are either ready for pick up or have been recalled:</p>
{{#each profile.plans as |plan|}}
<h3>{{plan.name}}</h3>
<ul>
   {{#each plan.prescriptions as |prescription|}}
   {%#if prescription.state = "ready" or prescription.state = "recall"%}
   <li>
      <strong>Prescription ID:</strong> {{prescription.prescription_id}}<br>
      <strong>Name:</strong> {{prescription.name}}<br>
      <strong>State:</strong> {{prescription.state}}
   </li>
   {%/if%}
   {{/each}}
</ul>
{{/each}}
配置文件数据
code language-javascript
{
  "profile": {
    "person": {
      "firstName": "John",
      "lastName": "Doe"
    },
    "plans": [
      {
        "planId": "plan1",
        "name": "Health Plan A",
        "prescriptions": [
          {
            "prescription_id": "pres1",
            "name": "Medication A",
            "state": "ready"
          },
          {
            "prescription_id": "pres2",
            "name": "Medication B",
            "state": "recall"
          }
        ]
      },
      {
        "planId": "plan2",
        "name": "Health Plan B",
        "prescriptions": [
          {
            "prescription_id": "pres3",
            "name": "Medication C",
            "state": "picked up"
          },
          {
            "prescription_id": "pres4",
            "name": "Medication D",
            "state": "ready"
          }
        ]
      }
    ]
  }
}
recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76