Postmark\PostmarkClient::editServer PHP Метод

editServer() публичный Метод

Modify the associated Server. Any parameters passed with NULL will be ignored (their existing values will not be modified).
public editServer ( string $name = NULL, string $color = NULL, boolean $rawEmailEnabled = NULL, boolean $smtpApiActivated = NULL, string $inboundHookUrl = NULL, string $bounceHookUrl = NULL, string $openHookUrl = NULL, boolean $postFirstOpenOnly = NULL, boolean $trackOpens = NULL, string $inboundDomain = NULL, integer $inboundSpamThreshold = NULL ) : Postmark\Models\DynamicResponseModel
$name string Set the name of the server.
$color string Set the color for the server in the Postmark WebUI (must be: 'purple', 'blue', 'turqoise', 'green', 'red', 'yellow', or 'grey')
$rawEmailEnabled boolean Enable raw email to be sent with inbound.
$smtpApiActivated boolean Specifies whether or not SMTP is enabled on this server.
$inboundHookUrl string URL to POST to everytime an inbound event occurs.
$bounceHookUrl string URL to POST to everytime a bounce event occurs.
$openHookUrl string URL to POST to everytime an open event occurs.
$postFirstOpenOnly boolean If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.
$trackOpens boolean Indicates if all emails being sent through this server have open tracking enabled.
$inboundDomain string Inbound domain for MX setup.
$inboundSpamThreshold integer The maximum spam score for an inbound message before it's blocked (range from 0-30).
Результат Postmark\Models\DynamicResponseModel
    function editServer($name = NULL, $color = NULL, $rawEmailEnabled = NULL, $smtpApiActivated = NULL, $inboundHookUrl = NULL, $bounceHookUrl = NULL, $openHookUrl = NULL, $postFirstOpenOnly = NULL, $trackOpens = NULL, $inboundDomain = NULL, $inboundSpamThreshold = NULL)
    {
        $body = array();
        $body["Name"] = $name;
        $body["Color"] = $color;
        $body["RawEmailEnabled"] = $rawEmailEnabled;
        $body["SmtpApiActivated"] = $smtpApiActivated;
        $body["InboundHookUrl"] = $inboundHookUrl;
        $body["BounceHookUrl"] = $bounceHookUrl;
        $body["OpenHookUrl"] = $openHookUrl;
        $body["PostFirstOpenOnly"] = $postFirstOpenOnly;
        $body["TrackOpens"] = $trackOpens;
        $body["InboundDomain"] = $inboundDomain;
        $body["InboundSpamThreshold"] = $inboundSpamThreshold;
        return new DynamicResponseModel($this->processRestRequest('PUT', '/server', $body));
    }

Usage Example

 function testClientCanEditServerInformation()
 {
     $tk = parent::$testKeys;
     $client = new PostmarkClient($tk->WRITE_TEST_SERVER_TOKEN, $tk->TEST_TIMEOUT);
     $originalServer = $client->getServer();
     $server = $client->editServer('testing-server-' . date('c'));
     //set it back to the original name.
     $client->editServer($originalServer->Name);
     $this->assertNotSame($originalServer->Name, $server->Name);
 }