Skip to content

Instantly share code, notes, and snippets.

@lobot
Created July 1, 2022 21:41
Show Gist options
  • Save lobot/bcf8c6f12d83e0e78ae4c5e744efc414 to your computer and use it in GitHub Desktop.
Save lobot/bcf8c6f12d83e0e78ae4c5e744efc414 to your computer and use it in GitHub Desktop.
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