Created
November 21, 2012 20:57
-
-
Save typerandom/4127669 to your computer and use it in GitHub Desktop.
AlphaMail Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include_once("comfirm.alphamail.client/emailservice.class.php"); | |
$email_service = AlphaMailEmailService::create() | |
->setServiceUrl("http://api.amail.io/v1") | |
->setApiToken("YOUR-ACCOUNT-API-TOKEN-HERE"); | |
$notification = array( | |
"user" => array( | |
"name" => "John" | |
), | |
"sender" => array( | |
"id" => "johanna82", | |
"name" => "Johanna" | |
), | |
"message" => array( | |
"id" => 12345, | |
"body" => "Hi John. Amazing pictures you've snapped! What is your secret? /Johanna" | |
) | |
); | |
$response = $email_service->queue(EmailMessagePayload::create() | |
->setProjectId(12345) // Your AlphaMail project (determines template, options, etc) | |
->setSender(new EmailContact("Photos4Lulz", "[email protected]")) | |
->setReceiver(new EmailContact("Joe Doe", "[email protected]")) | |
->setBodyObject($notification) | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment