public function validateSettings()
 {
     $result = parent::validateSettings();
     if (!$this->getSetting('Subject')) {
         $result->error(_t('Push.EMAILSUBJECTREQUIRED', 'An email subject is required'));
     }
     return $result;
 }
 public function setSettings(array $data)
 {
     parent::setSettings($data);
     if (isset($data['Devices'])) {
         if (is_array($data['Devices'])) {
             $this->setSetting('Devices', implode(',', $data['Devices']));
         } else {
             $this->setSetting('Devices', $data['Devices']);
         }
     }
     $this->setSetting('App', isset($data['App']) ? (string) $data['App'] : null);
     $this->setSetting('Sound', isset($data['Sound']) ? (string) $data['Sound'] : null);
     $this->setSetting('Badge', isset($data['Badge']) ? (string) $data['Badge'] : null);
 }