Return an array representing a MailSettings object for the Twilio SendGrid API

@return null|array
339047
public function jsonSerialize()
    {
        return array_filter(
            [
                'bcc' => $this->getBccSettings(),
                'bypass_list_management' => $this->getBypassListManagement(),
                'footer' => $this->getFooter(),
                'sandbox_mode' => $this->getSandboxMode(),
                'spam_check' => $this->getSpamCheck()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
735213
public function getMailboxes(): array
    {
        $this->initMailboxNames();

        if (null === $this->mailboxes) {
            $this->mailboxes = [];
            foreach ($this->mailboxNames as $mailboxName => $mailboxInfo) {
                $this->mailboxes[(string) $mailboxName] = $this->getMailbox((string) $mailboxName);
            }
        }

        return $this->mailboxes;
    }
777777
public function missingSettings()
    {
        $missing = [];
        foreach($this->recommendedSettings() as $plugin => $settings) {
            foreach($settings as $setting) {
                /* Get value for the setting */
                $value = $_ENV[$setting] ?? null;

                if(is_null($value)) $missing[$plugin][] = $setting;
            }
        }
        return $missing;
    }
868567
protected function getMailer()
    {
        $transport = null;
        if ($this->configurationManager->getSetting('mailer.type') === 'sendmail') {
            $transport = \Swift_SendmailTransport::newInstance($this->configurationManager->getSetting('mailer.sendmailCommand'));
        } else if ($this->configurationManager->getSetting('mailer.type') === 'smtp') {
            $host = $this->configurationManager->getSetting('mailer.smtpHost');
            $port = $this->configurationManager->getSetting('mailer.smtpPort');
            $username = $this->configurationManager->getSetting('mailer.smtpUsername');
            $password = $this->configurationManager->getSetting('mailer.smtpPassword');
            
            $transport = \Swift_SmtpTransport::newInstance($host, $port);
            $transport->setUsername($username);
            $transport->setPassword($password);
        }
        
        if ($transport === null) {
            throw new Exception('No mail transport defined. Please check your configuration.');
        }

        return \Swift_Mailer::newInstance($transport);
    }
672176
public function getSettings(): array
    {
        $result = [];
        $settings = static::find()->select(['type', 'section', 'key', 'value'])->active()->asArray()->all();

        foreach ($settings as $setting) {
            $section = $setting['section'];
            $key = $setting['key'];
            $settingOptions = ['type' => $setting['type'], 'value' => $setting['value']];

            if (isset($result[$section][$key])) {
                ArrayHelper::merge($result[$section][$key], $settingOptions);
            } else {
                $result[$section][$key] = $settingOptions;
            }
        }

        return $result;
    }
291860
public function getSettings()
    {
        return json_encode([
            'connect_url'                   => $this->getConnectJsUrl(),
            'publishable_key_back_office'   => $this->getBackOfficeKey(),
            'create_order_url'              => $this->getUrl(Config::CREATE_ORDER_ACTION),
            'save_order_url'                => $this->getUrl(Config::SAVE_ORDER_ACTION),
        ]);
    }
603794
public function getUserInput(): array
    {
        $data = [
            'email' => $this->input('email'),
            'is_active' => $this->filled('is_active') ? 1 : 0,
        ];

        if ($this->input('password')) {
            Arr::set($data, 'password', $this->input('password'));
        }

        return $data;
    }
289256
public function get_setting() {
        $result = $this->config_read($this->name);

        if (is_null($result)) {
            return NULL;
        }
        if ($result === '') {
            return array();
        }
        $enabled = explode(',', $result);
        $setting = array();
        foreach ($enabled as $option) {
            $setting[$option] = 1;
        }
        return $setting;
    }
500577
public function getFormats()
    {
        return [
            'date'     => $this->getDateFormatHelper()->getFormatsDate(),
            'datetime' => $this->getDateFormatHelper()->getFormatsDateTime(),
            'time'     => $this->getDateFormatHelper()->getFormatsTime(),
            'number'   => $this->formatNumber,
            'boolean'  => $this->formatBoolean,
            'string'   => $this->formatString,
            'region'   => $this->formatString,
            'tel'      => $this->formatTel,
            'text'     => $this->formatText,
            'email'    => $this->formatEmail,
        ];
    }
979365
public function get_setting() {
        $seconds = $this->config_read($this->name);
        if (is_null($seconds)) {
            return null;
        }

        return self::parse_seconds($seconds);
    }
294127
public static function get_settings() {
		// If the gforms plugin is not active.
		if ( ! class_exists( 'GFWebAPI' ) ) {
			return false;
		}

		$settings = get_option( 'gravityformsaddon_gravityformswebapi_settings' );

		// If the API is not enabled.
		if ( empty( $settings ) || ! $settings['enabled'] ) {
			return false;
		}

		$forms = [];

		$method = 'GET';

		$expires = strtotime( self::SIGNATURE_EXPIRY );

		foreach ( \GFAPI::get_forms() as $form ) {

			$get_form_route = 'forms/' . $form['id'];

			$string_to_sign = sprintf( '%s:%s:%s:%s', $settings['public_key'], $method, $get_form_route, $expires );

			$forms[ $form['id'] ] = [
				'get_form' => [
					'route' => $get_form_route,
					'expires' => $expires,
					'signature' => self::calculate_signature( $string_to_sign, $settings['private_key'] ),
				],
				'post_submission' => [
					'route' => 'forms/' . $form['id'] . '/submissions',
				],
			];
		}

		return [
			'api_base' => GFWEBAPI_API_BASE_URL,
			'api_key' => $settings['public_key'],
			'forms' => $forms,
		];
	}
743259
protected function getFrom()
    {
        $email = $this->config->get('phpci.email_settings.from_address', self::DEFAULT_FROM);

        if (empty($email)) {
            $email = self::DEFAULT_FROM;
        }

        return $email;
    }
520161
public function jsonSerialize()
    {
        // Detect if we are using the new dynamic templates
        $template_id = $this->getTemplateId();
        if ($template_id != null) {
            if (substr((string) $template_id->getTemplateId(), 0, 2) == "d-") {
                foreach ($this->personalization as $personalization) {
                    $personalization->setHasDynamicTemplate(true);
                }
            }
        }
        return array_filter(
            [
                'personalizations' => $this->getPersonalizations(),
                'from' => $this->getFrom(),
                'reply_to' => $this->getReplyTo(),
                'subject' => $this->getGlobalSubject(),
                'content' => $this->getContents(),
                'attachments' => $this->getAttachments(),
                'template_id' => $this->getTemplateId(),
                'sections' => $this->getSections(),
                'headers' => $this->getGlobalHeaders(),
                'categories' => $this->getCategories(),
                'custom_args' => $this->getGlobalCustomArgs(),
                'send_at' => $this->getGlobalSendAt(),
                'batch_id' => $this->getBatchId(),
                'asm' => $this->getASM(),
                'ip_pool_name' => $this->getIpPoolName(),
                'substitutions' => $this->getGlobalSubstitutions(),
                'mail_settings' => $this->getMailSettings(),
                'tracking_settings' => $this->getTrackingSettings()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
579864
protected function getEveryOption()
    {
        return [
            'notmailed'     => $this->_('Not emailed'),
            'tomail'        => $this->_('To email'),
            'toremind'      => $this->_('Needs reminder'),
            'hasnomail'     => $this->_('Missing email'),
            'notmailable'   => $this->_('Not allowed to email'),
        ];
    }
331029
protected function createSettings($data = null): MailSettings
    {
        if (method_exists($this, 'getPayload')) {
            $data = $this->getPayload($data);
        }

        if ($data instanceof MailSettings) {
            return $data;
        }

        return new $this->settings($data);
    }
1213613
public function getRecipients()
    {
        switch ($this->getSystemMessageType()) {
            case self::LETTER_TYPE_NORMAL:
                return $this->data['recipients'];
                break;

            case self::LETTER_TYPE_HYBRID:
                return $this->data['recipientsPrinted'];
                break;
        }

        return null;
    }
1299135
public static function getAllSettings()
    {
        $settings = Settings::all();

        $settingsList = [];
        foreach($settings as $setting){
            $settingsList[$setting->settingsKey] = $setting->value;
        }

        return $settingsList;
    }