Created
June 15, 2020 19:15
-
-
Save biancalpadilla/543ce9194c306812ba0de1cc1dab322a to your computer and use it in GitHub Desktop.
POSTMARK EXAMPLES, available in curl, Ruby, C#, PHP, Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy and paste this into terminal | |
curl "https://api.postmarkapp.com/email/withTemplate" \ | |
-X POST \ | |
-H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-H "X-Postmark-Server-Token: TOKEN" \ | |
-d '{ | |
"From": "[email protected]", | |
"To": "[email protected]", | |
"TemplateAlias": "receipt", | |
"TemplateModel": { | |
"shipping": { | |
"first_name": "first_name_Value", | |
"last_name": "last_name_Value", | |
"street_1": "street_1_Value", | |
"street_2": "street_2_Value", | |
"city": "city_Value", | |
"state": "state_Value", | |
"zip": "zip_Value", | |
"phone": "phone_Value" | |
}, | |
"order": { | |
"id": "id_Value", | |
"date_created": "date_created_Value", | |
"total_inc_tax": "total_inc_tax_Value", | |
"items_total": "items_total_Value", | |
"discount": { | |
"total": "total_Value" | |
}, | |
"coupon": { | |
"total": "total_Value" | |
}, | |
"store_credit": { | |
"total": "total_Value" | |
}, | |
"subtotal_ex_tax": "subtotal_ex_tax_Value", | |
"free_shipping": { | |
}, | |
"base_shipping_cost": "base_shipping_cost_Value", | |
"total_tax": "total_tax_Value" | |
}, | |
"products": [ | |
{ | |
"url": "url_Value", | |
"image_url": "image_url_Value", | |
"name": "name_Value", | |
"options": [ | |
{ | |
"display_value": "display_value_Value" | |
} | |
], | |
"quantity": "quantity_Value", | |
"base_price": "base_price_Value" | |
} | |
], | |
"email": "email_Value" | |
} | |
}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Send an email with curl | |
curl "https://api.postmarkapp.com/email/withTemplate" \ | |
-X POST \ | |
-H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-H "X-Postmark-Server-Token: TOKEN" \ | |
-d '{ | |
"From": "[email protected]", | |
"To": "[email protected]", | |
"TemplateAlias": "shipment-confirmation", | |
"TemplateModel": { | |
"shipments": [ | |
{ | |
"tracking_number": "tracking_number_Value", | |
"items": [ | |
{ | |
"url": "url_Value", | |
"image_url": "image_url_Value", | |
"name": "name_Value", | |
"options": [ | |
{ | |
"display_value": "display_value_Value" | |
} | |
], | |
"quantity": "quantity_Value", | |
"base_price": "base_price_Value" | |
} | |
] | |
} | |
], | |
"order": { | |
"id": "id_Value", | |
"date_created": "date_created_Value", | |
"total_inc_tax": "total_inc_tax_Value", | |
"items_total": "items_total_Value", | |
"discount": { | |
"total": "total_Value" | |
}, | |
"coupon": { | |
"total": "total_Value" | |
}, | |
"store_credit": { | |
"total": "total_Value" | |
}, | |
"subtotal_ex_tax": "subtotal_ex_tax_Value", | |
"free_shipping": { | |
}, | |
"base_shipping_cost": "base_shipping_cost_Value", | |
"total_tax": "total_tax_Value" | |
}, | |
"shipping": { | |
"first_name": "first_name_Value", | |
"last_name": "last_name_Value", | |
"street_1": "street_1_Value", | |
"street_2": "street_2_Value", | |
"city": "city_Value", | |
"state": "state_Value", | |
"zip": "zip_Value", | |
"phone": "phone_Value" | |
}, | |
"multiple_shipments": { | |
"shipments": [ | |
{ | |
"package": "package_Value", | |
"tracking_number": "tracking_number_Value", | |
"items": [ | |
{ | |
"url": "url_Value", | |
"image_url": "image_url_Value", | |
"name": "name_Value", | |
"options": [ | |
{ | |
"display_value": "display_value_Value" | |
} | |
], | |
"quantity": "quantity_Value", | |
"base_price": "base_price_Value" | |
} | |
] | |
} | |
] | |
}, | |
"email": "email_Value" | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment