@startuml skinparam NoteTextAlignment left skinparam Padding 2 skinparam ParticipantPadding 40 skinparam LifelineStrategy solid autonumber participant "FHIR Server\nREST API" as S participant "Client" as C participant "Email Server\n(SMTP/S, Direct)" as E group Negotiating a Subscription C->S: Create Subscription\n""channel.type: email"" else Without handshake S-->C: Success\n""Subscription.status: active"" ||| else With handshake S-->C: Success\n""Subscription.status: requested"" S->E: Message with verification, opt-in, opt-out, etc. return SMTP Success, e.g.:\n""250: OK"" ... note right of S Server updates Subscription: ""Subscription.status: active"" end note end group Email Subscription Processing else Server sends heartbeat S->E: Message with readable content and attached Bundle:\n"" Bundle.type: history""\n""SubscriptionStatus.type: heartbeat"" ... else Server sends event-notification S->E: Message with readable content and attached Bundle:\n"" Bundle.type: history""\n""SubscriptionStatus.type: event-notification"" ... end @enduml