Skip to content

Instantly share code, notes, and snippets.

@lobot
Created July 1, 2022 21:40
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/29ba63774615b1e3a54715e50ef32bbc to your computer and use it in GitHub Desktop.
Save lobot/29ba63774615b1e3a54715e50ef32bbc to your computer and use it in GitHub Desktop.
require 'lob.rb'
require 'pp'
lob = Lob::Client.new(api_key: "<TEST_API_KEY>")
pp lob.postcards.create(
description: "First Postcard",
to: {
name: "Harry Zhang",
address_line1: "210 King Street",
address_city: "San Francisco",
address_state: "CA",
address_zip: "94107"
},
from: {
name: "Leore Avidar",
address_line1: "210 King Street",
address_city: "San Francisco",
address_state: "CA",
address_zip: "94107"
},
merge_variables: { name: "Harry" },
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>"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment