<?hh // strict

use Mailgun\Mailgun;

class MailgunEmailClient extends EmailClient {
  private Mailgun $client;
  public string $domain;
  public string $email;

  public function __construct(string $api_key, string $domain, string $from_email): void {
    $this->client = new Mailgun($api_key);
    $this->domain = $domain;
    $this->email = $from_email;
  }

  public function send(string $to, string $subject, string $body): void {
    $this->client->sendMessage($this->domain, Map {
      'from' => $this->email,
      'to' => $to,
      'subject' => $subject,
      'text' => $body
    });
  }
}

<?hh // strict

class MailgunEmailClient extends EmailClient {
  private Mailgun\Mailgun $client;
  public string $domain;
  public string $email;

  public function __construct(string $api_key, string $domain, string $from_email): void {
    $this->client = new Mailgun\Mailgun($api_key);
    $this->domain = $domain;
    $this->email = $from_email;
  }

  public function send(string $to, string $subject, string $body): void {
    $this->client->sendMessage($this->domain, Map {
      'from' => $this->email,
      'to' => $to,
      'subject' => $subject,
      'text' => $body
    });
  }
}

--- 
+++ 
@@ -1,12 +1,14 @@
 <?hh // strict
 
+use Mailgun\Mailgun;
+
 class MailgunEmailClient extends EmailClient {
-  private Mailgun\Mailgun $client;
+  private Mailgun $client;
   public string $domain;
   public string $email;
 
   public function __construct(string $api_key, string $domain, string $from_email): void {
-    $this->client = new Mailgun\Mailgun($api_key);
+    $this->client = new Mailgun($api_key);
     $this->domain = $domain;
     $this->email = $from_email;
   }
Use 'use' keyword for Mailgun
