Skip to content

Instantly share code, notes, and snippets.

@typerandom
Created November 21, 2012 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typerandom/4127669 to your computer and use it in GitHub Desktop.
Save typerandom/4127669 to your computer and use it in GitHub Desktop.
AlphaMail Example
<?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", "notification@photos4lulz.com"))
->setReceiver(new EmailContact("Joe Doe", "john.doe@doh.com"))
->setBodyObject($notification)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment