의료 서비스 플랜 처방 전자 메일 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