Skip to content

Instantly share code, notes, and snippets.

@lobot
Created Jul 1, 2022
Embed
What would you like to do?
qs-php-code
<?php require __DIR__ . '/vendor/autoload.php';
$lob = new \Lob\Lob('<TEST_API_KEY');
$postcard = $lob->postcards()->create(array(
"description" => "First Postcard",
"to[name]" => "HARRY ZHANG",
"to[address_line1]" => "210 KING STREET",
"to[address_city]" => "SAN FRANCISCO",
"to[address_state]" => "CA",
"to[address_zip]" => "94107",
"from[name]" => "LEORE AVIDAR",
"from[address_line1]" => "210 KING STREET",
"from[address_city]" => "SAN FRANCISCO",
"from[address_state]" => "CA",
"from[address_zip]" => "94107",
"front" => "<html style='padding: 1in; font-size: 50;'>Front HTML for {{name}}</html>",
"back" => "<html style='padding: 1in; font-size: 20;'>Back HTML for {{name}}</html>",
"merge_variables[name]" => "Harry"
));
print_r($postcard);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment