WARNING: This page is about a different car, the 2016 Hyundai Elantra GT and 2015 Hyundai Elantra GT. However, it is still accessible from the selected car via links, so may be relevant.
Check for continuity between the Trunk lid open switch terminals.
Fig 1: Identifying Tailgate Open Switch Connector
Courtesy of HYUNDAI MOTOR AMERICA
If continuity is not specified, inspect the switch
Fig 2: Tailgate Open Switch Terminals Continuity Chart