Email Notification not received upon subscription

29 views
Skip to first unread message

nmmou...@gmail.com

unread,
Jan 8, 2020, 9:48:01 AM1/8/20
to HAPI FHIR
I am trying to do a test on http://hapi.fhir.org/, on testing if I am receiving notifications on subscriptions.

Below is the subscription I have created and patient matching the subscription expecting an email notifcation which I havent received any..?

Subscription

{
     "resourceType": "Subscription",
     "id": "994734", 
     "status": "requested",
     "criteria": "Patient?name=smitha",
     "channel": {
       "type": "email",
       "endpoint": "mailto:a...@gmail.com",
       "header": "A new patient has been created"
     }
  
 }

Patient:

{
  "resourceType": "Patient",
  "id": "051911",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<table>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Name</td>\n\t\t\t\t\t\t<td>Peter James \n              <b>Chalmers</b> (&quot;Jim&quot;)\n            </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Address</td>\n\t\t\t\t\t\t<td>534 Erewhon, Pleasantville, Vic, 3999</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Contacts</td>\n\t\t\t\t\t\t<td>Home: unknown. Work: (03) 5555 6473</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Id</td>\n\t\t\t\t\t\t<td>MRN: 12345 (Acme Healthcare)</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>"
  },
  "identifier": [
    {
      "use": "usual",
      "type": {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
            "code": "MR"
          }
        ]
      },
      "system": "urn:oid:1.2.36.146.595.217.0.1",
      "value": "12345",
      "period": {
        "start": "2001-05-06"
      },
      "assigner": {
        "display": "Acme Healthcare"
      }
    }
  ],
  "active": true,
  "name": [
    {
      "use": "official",
      "family": "smitha",
      "given": [
        "smitha"
      ]
    }
      ]
  }

James Agnew

unread,
Jan 8, 2020, 11:11:59 AM1/8/20
to nmmou...@gmail.com, HAPI FHIR
Hi,

Unfortunately we have not enabled email delivery on our public server because of the potential for abuse. Email Subscriptions are supported by HAPI FHIR server, so you could set up an instance of hapi-fhir-jpaserver-starter with email subscriptions turned on, but you need to supply it with an SMTP server.

Cheers,
Jame

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/3223de36-6f21-4ccc-b6ae-b00d7600212b%40googlegroups.com.
Message has been deleted

nmmou...@gmail.com

unread,
Jan 12, 2020, 7:09:05 PM1/12/20
to HAPI FHIR
Hi Agnew,

Thank you for the response. I did setup FHIR JPA Server Starter project and trying to test email subscriptions, but have received following error.

Below are my following settings, followed by error details

subscription.email.enabled=true

email.enabled=true

email.from=abc@gmail.com

email.host=smtp.gmail.com

email.port=587

email.username=abc@gmail.com

email.password=abc


2020-01-12 19:00:41.373 [subscription-delivery-email-10-1] ERROR c.u.f.j.s.m.s.BaseSubscriptionDeliverySubscriber [BaseSubscriptionDeliverySubscriber.java:84] Failure handling subscription payload for subscription: Subscription/10

org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. j4sm4706409qtv.53 - gsmtp


at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:490)

at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:360)

at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:355)

at ca.uhn.fhir.jpa.subscription.module.subscriber.email.JavaMailEmailSender.send(JavaMailEmailSender.java:132)

at ca.uhn.fhir.jpa.subscription.module.subscriber.email.SubscriptionDeliveringEmailSubscriber.handleMessage(SubscriptionDeliveringEmailSubscriber.java:79)

at ca.uhn.fhir.jpa.subscription.module.subscriber.BaseSubscriptionDeliverySubscriber.handleMessage(BaseSubscriptionDeliverySubscriber.java:76)

at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:144)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

2020-01-12 19:00:41.374 [subscription-delivery-email-10-1] INFO  c.u.f.j.s.m.i.S.SUBS6 [SubscriptionDebugLogInterceptor.java:162] Delivery of resource Patient/11/_history/1 for subscription Subscription/10 to channel of type EMAIL - Failure: org.springframework.mail.MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. j4sm4706409qtv.53 - gsmtp

; message exceptions (1) are:

Failed message 1: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. j4sm4706409qtv.53 - gsmtp

To unsubscribe from this group and stop receiving emails from it, send an email to hapi...@googlegroups.com.

Kevin Mayfield

unread,
Jan 13, 2020, 3:40:41 AM1/13/20
to nmmou...@gmail.com, HAPI FHIR
I think you need to tell the client to use TLS.

Is it possible to replace the channel delivery classes? I'd probably need more control over sending emails (resthook and sms).

To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/03877443-1433-4d5d-8c6d-96ab35163d34%40googlegroups.com.

Ken Stevens

unread,
Jan 13, 2020, 11:21:07 AM1/13/20
to HAPI FHIR
I added TLS support for email subscriptions in a couple of MRs:


Please let me know if you're available to help test this.

Ken
Reply all
Reply to author
Forward
0 new messages