Postmark\PostmarkAdminClient::createSenderSignature PHP 메소드

createSenderSignature() 공개 메소드

Create a new Sender Signature for a given email address. Note that you will need to "verify" this Sender Signature by following a link that will be emailed to the "fromEmail" address specified when calling this method.
public createSenderSignature ( string $fromEmail, string $name, string $replyToEmail = NULL, string $returnPathDomain = NULL ) : Postmark\Models\DynamicResponseModel
$fromEmail string The email address for the Sender Signature
$name string The name of the Sender Signature.
$replyToEmail string The reply-to email address for the Sender Signature.
$returnPathDomain string The custom Return-Path domain for the Sender Signature.
리턴 Postmark\Models\DynamicResponseModel
    function createSenderSignature($fromEmail, $name, $replyToEmail = NULL, $returnPathDomain = NULL)
    {
        $body = array();
        $body['fromEmail'] = $fromEmail;
        $body['name'] = $name;
        $body['replyToEmail'] = $replyToEmail;
        $body['returnPathDomain'] = $returnPathDomain;
        return new DynamicResponseModel($this->processRestRequest('POST', '/senders/', $body));
    }

Usage Example

 function testClientCanVerifySPFForSignature()
 {
     $tk = parent::$testKeys;
     $client = new PostmarkAdminClient($tk->WRITE_ACCOUNT_TOKEN, $tk->TEST_TIMEOUT);
     $name = 'test-php-spf-' . date('U');
     $i = $tk->WRITE_TEST_SENDER_SIGNATURE_PROTOTYPE;
     $sender = str_replace('[token]', 'test-php-spf-' . date('U'), $i);
     $sig = $client->createSenderSignature($sender, $name);
     $client->verifySenderSignatureSPF($sig->id);
 }