Salesforce
Send a note to a Salesforce Contact from a Flow, Apex or Zapier.
Salesforce stays your system of record. You pick who gets a card in Salesforce, and Salesforce calls the Stylograph API to send it.
What works today
Anything in Salesforce that can make an HTTP request can send a note: a Flow with an HTTP callout, or Apex. Zapier works too, with a Salesforce trigger and a Webhooks by Zapier step, as on the Zapier page. Check Salesforce's own docs for how to set up a callout in your org.
Keep the API key in a Named Credential or another secret store, never in a Flow's text.
The call is POST /api/v1/notes with an Idempotency-Key built from the record that started it, such as sf-task-00T5e00000AbCdE. Map the Contact's mailing address to recipient:
| Salesforce Contact | recipient field |
|---|---|
Salutation | honorific |
FirstName | first_name |
LastName | last_name |
Account.Name | company |
MailingStreet, first line | address_line1 |
MailingStreet, any other lines | address_line2 |
MailingCity | city |
MailingState, as a two-letter code | state |
MailingPostalCode | zip |
The API takes US addresses only, with a two-letter state and a five-digit ZIP, so leave out Contacts with a mailing address in another country. A send whose address USPS doesn't confirm is refused, so try a new list with dry_run: true first.
Send crm_contact as { "source": "salesforce", "id": "<Contact Id>" } too, so two Flows that fire on the same Contact mail one card that day.
The key needs notes:send and recipients:write. A Contact is added to your Stylograph address book the first time you send to them, and matched to the same entry after that.
To record the card in Salesforce, keep the note id or reference from the answer on the record that started it. To follow it to delivery, poll GET /api/v1/notes with updated_since. See Note status.
Without automation
Export a report of Contacts, import it in the Note Composer under Recipients, and send them as a campaign.
To load the same list into your address book from code instead, send it to POST /api/v1/recipients/import. See Recipients.
Planned
A built-in Salesforce connection is planned. An Org Admin would connect your org to a team from Settings and pick one active Campaign. Its Contacts with a US mailing address would be added to your address book, and when a card to one of them is mailed, a completed Task would be logged on the Contact with the note's reference, never its message. There is no date yet.
A Salesforce app that you install from the AppExchange and connect without copying a key would need OAuth apps first. It isn't scheduled.