Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lobot
Created July 1, 2022 21:38
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 lobot/ce7ba932e3748fa349c01e3364e3e519 to your computer and use it in GitHub Desktop.
Save lobot/ce7ba932e3748fa349c01e3364e3e519 to your computer and use it in GitHub Desktop.
qs-python-code
import lob
lob.api_key = "<YOUR_TEST_KEY>"
postcard = lob.Postcard.create(
description = "First Postcard",
to_address = {
"name": "Harry Zhang",
"address_line1": "210 King Street",
"address_city": "San Francisco",
"address_state": "CA",
"address_zip": "94107"
},
from_address = {
"name": "Leore Avidar",
"address_line1": "210 King Street",
"address_city": "San Francisco",
"address_state": "CA",
"address_zip": "94107",
"address_country": "US"
},
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(postcard)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment