PHP 클래스 SparkPost\Transmission

상속: extends ResourceBase
파일 보기 프로젝트 열기: sparkpost/php-sparkpost 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( SparkPost $sparkpost )
formatPayload ( array $payload ) : array Runs the given payload through the formatting functions.
post ( $payload = [], $headers = [] ) : SparkPostPromise Send post request to transmission endpoint after formatting cc, bcc, and expanding the shorthand emails.

비공개 메소드들

메소드 설명
addListToRecipients ( array $payload, array $listName ) : array Loops through the given listName in the payload and adds all the recipients to the recipients list after removing their names.
formatBlindCarbonCopy ( array $payload ) : array Formats bcc list into recipients list.
formatCarbonCopy ( array $payload ) : array Formats cc list into recipients list and adds the CC header to the content.
formatShorthandRecipients ( array $payload ) : array Formats all recipients into the long form of [ "name" => "John", "email" => "[email protected]" ].
isEmail ( string $email ) Checks if a string is an email.
toAddressObject ( $address ) : array Takes the shorthand form of an email address and converts it to the long form.
toAddressString ( $address ) Takes the longhand form of an email address and converts it to the shorthand form.

메소드 상세

__construct() 공개 메소드

public __construct ( SparkPost $sparkpost )
$sparkpost SparkPost

formatPayload() 공개 메소드

Runs the given payload through the formatting functions.
public formatPayload ( array $payload ) : array
$payload array - the request body
리턴 array - the modified request body

post() 공개 메소드

Send post request to transmission endpoint after formatting cc, bcc, and expanding the shorthand emails.
public post ( $payload = [], $headers = [] ) : SparkPostPromise
리턴 SparkPostPromise or SparkPostResponse depending on sync or async request