What an app can do
A key can do one or more of these. Give each app only what it needs.
Send emails
Send a campaign you wrote to a student, a household or an address. candl fills the merge tags and sends from your Google account.
Look up information
Read back one student or family, find whose phone number it is, or learn whether an email went out.
Get personal links
Get one person’s form link or report link, for the app to put in its own message or text.
Before you start
- You need the right to manage webhooks. Without it, ask an administrator to connect the app (see roles and permissions).
- A key acts as the person who makes it. Its emails go out from that person’s Google account and count toward their daily limit. Its lookups see only the students and families that person can open in candl, and never return giving. A send fills giving tags only if someone with giving access allowed it for the key.
- Use one key per app. Each can then be turned off on its own.
- The key is shown once. candl keeps only a fingerprint of it. If it is lost, make a new secret; the old one stops working at once.
Connect an app
Open Settings, Connected apps, and choose Connect an app. You can also start from the thing the app will use:
- a campaign: the builder menu, Send from another app
- a form: its row menu in Forms, Use in another app
- a report shared by link, each reader their own part: the link icon beside it, Use in another app
Say what it should do
Pick one or more jobs and give the app a name you will recognize, like AppSheet, bus forms. Started from a campaign, form or report link, the job is already chosen.
Choose the key
Use a key an app already has, or make a new one. If a key already sends that campaign, candl opens straight on its steps.
Set up the job
For sending: the campaigns it may send. For lookups: what it can look up and how much it can see. For links: which forms or report links.
Paste it into the app
Pick AppSheet, Zapier, Make or Something else. The steps have the address, the header with your key, and a body made for this campaign or lookup. Copy the header now: it is the only time the whole key is shown.
Send emails
The app names the campaign and who it is for. candl looks up the family, fills the merge tags, and sends within about a minute. Write the campaign in candl first, as in Send a campaign.
Example: confirm an interview from AppSheet
An admissions app has a row per applicant. When the interview is booked, a bot sends the Interview confirmation campaign to the parents and records whether it went.
- In the bot, add a step that runs a task: Call a webhook, preset Custom, HTTP verb Post, content type JSON.
- Url:
https://hooks.candlstudio.us/send - HTTP Headers:
Authorization: Bearerand your key. - Body, with your own column names:
POST /send
{ "campaign": "cmp_interview", "studentId": "<<[Student ID]>>", "vars": { "interviewDate": "<<TEXT([Interview], \"MMM D\")>>", "interviewer": "<<[Interviewer]>>" }, "requireAddress": "report" } - Turn on Return value and add
ok(Yes/No) andreason(Text). Leave Run asynchronously off so the bot waits for the answer. - In a later step, record the outcome, for example:
IF([Send step].[ok], "Sent", "Not sent: " & [Send step].[reason])
"requireAddress": "report"? Without it candl answers before it has looked up the family, so a family with no email on file is never sent anything and the app never hears why. With it, candl sends only when the email would reach someone, and answers with ok and reason whether or not it sent, so a family with no email does not stop the bot. A wrong key, a refusal, or candl being unreachable still does. It needs Check there’s an email on file first, which is on for new keys.Example: the same from Zapier
Action Webhooks by Zapier, event Custom Request, method POST. Put the body in Data, and under Headers add Authorization with Bearer and your key, and Content-Type with application/json. Insert fields from earlier steps where the example has values.
{
"campaign": "cmp_interview",
"studentId": "12345",
"vars": {
"interviewDate": "Dec 2",
"interviewer": "Rabbi Levine"
},
"requireAddress": true
}Zapier and Make use "requireAddress": true: when nothing would arrive, candl answers 422 with the reason and the Zap stops there, so you see it.
Who it goes to
studentId- A student number, as in the Directory. The campaign decides whether it goes to the parents or the student. A second household gets its own email.
memberCode- A household code. Goes to that household.
to- Email addresses, separated by commas. One email to all of them. Used instead of the two above.
Use the campaign ID in campaign, as the steps give it, not the name: renaming a campaign then breaks nothing.
to accepts commas or semicolons between addresses, ignores repeats, and refuses more than 10 with a 400 that says so.Merge tags
A campaign’s tags, like {{firstName}} or {{parentGreeting}}, fill the same way as when you send from candl, as long as the app says who the email is for. The full list of tags is in Merge tags.
| The app sends | The campaign’s tags fill from |
|---|---|
studentId or memberCode | That student’s or household’s record in candl. A value the app sends in vars wins over the record. A second household gets its own greeting and names. |
to only | Only what the app sends in vars. Any other tag comes out blank, because candl does not know whose record it is. |
to and a studentId | The record, sent to those addresses instead. If an address is not on that record, the key needs Send records to other addresses; without it candl refuses the send, so one family’s details never reach someone else. |
- Its own email
- With no campaign, tags in
messagefill from the record only when candl chose the address from astudentIdormemberCode. Withto, they fill fromvarsonly. - Subject, Cc, Reply-To
- Tags in text the app sends fill only from its own
vars, never from the record. - Giving tags
- Fill only if someone with giving access turned on Use giving tags for the key, and never from text the app sends.
- Personal links
- A report link or no-login form link in the campaign is personal only when the app names the student or household. With
to, the reader gets the sign-in link.
So for a letter that greets the family and fills their details, send the studentId, and use vars only for what candl does not have, like an interview date.
Look up information
The app asks about one student, family or phone number at a time and gets back only the details the key may see, within what its owner can see in candl (What you can see).
Example: fill in a student’s details in a bus sheet
A transportation app has the student number on each row and needs the name, grade and parents’ greeting.
{
"lookup": "student",
"studentId": "12345",
"fields": [
"firstName",
"lastName",
"grade",
"parentGreeting"
]
}candl answers:
{
"ok": true,
"lookup": "student",
"found": true,
"studentId": "12345",
"firstName": "Levi",
"lastName": "Cohen",
"grade": "10",
"parentGreeting": "Dear Mr. and Mrs. Cohen",
"fields": {
"firstName": "Levi",
"lastName": "Cohen",
"grade": "10",
"parentGreeting": "Dear Mr. and Mrs. Cohen"
}
}In AppSheet, add a Return value for each detail you want, named exactly as in the answer: found (Yes/No), firstName (Text), and so on. Check found before using the rest.
The four kinds of lookup
"lookup": "student"- With
studentId. Add"fields": ["firstName", "grade"]to get only those; without it you get every detail the key may see. "lookup": "household"- With
memberCode, andfieldsthe same way. "lookup": "phone"- With
phone. Answersrole(father, mother or student),nameandstudentId. Also works as a GET:/lookup?lookup=phone&phone=4105550100. "lookup": "delivery"- With
queued, the ID a send answered.statusis pending, sending, sent, refused or error, witherrorsaying why when it was refused or failed. Sent means it is in candl’s mail queue, which sends it within a minute or two. Only for this key’s own sends.
What it can see
Pick a level when you set it up: Names, Names and class, or Everything, which adds emails, cell numbers and address. Or choose details one by one. These are the names to use in fields and as AppSheet return values.
A student
| Name | Is | From level |
|---|---|---|
firstName | First name | Names |
lastName | Last name | Names |
fullName | Full name | Names |
householdCode | Household code | Names |
enrolled | Enrolled now | Names and class |
division | Division | Names and class |
grade | Grade | Names and class |
shiur | Shiur | Names and class |
rebbe | Rebbe | Names and class |
englishClass | English class | Names and class |
parentNames | Parents names | Names |
parentTitles | Parents titles | Names |
parentGreeting | Parents greeting | Names |
fatherName | Father name | Names |
motherName | Mother name | Names |
fatherEmail | Father email | Everything |
motherEmail | Mother email | Everything |
fatherCell | Father cell | Everything |
motherCell | Mother cell | Everything |
homePhone | Home phone | Everything |
studentEmail | Student email | Everything |
studentCell | Student cell | Everything |
address | Address | Everything |
city | City | Everything |
state | State | Everything |
A household
| Name | Is | From level |
|---|---|---|
lastName | Last name | Names |
parentNames | Parents names | Names |
parentTitles | Parents titles | Names |
parentGreeting | Parents greeting | Names |
fatherName | Father name | Names |
motherName | Mother name | Names |
children | Children (ID and name) | Names |
fatherEmail | Father email | Everything |
motherEmail | Mother email | Everything |
fatherCell | Father cell | Everything |
motherCell | Mother cell | Everything |
homePhone | Home phone | Everything |
address | Address | Everything |
city | City | Everything |
state | State | Everything |
{"found": false}. A detail it may not read is listed in notAllowed instead of answered. A key may look up 500 times a day unless you change it.Get personal links
The app gets one person’s link and sends it itself, for example in a text. The links are the same ones described in Build a form and Reports.
Example: a bus registration link for a family
{
"kind": "form",
"formId": "bus_registration",
"studentId": "12345",
"short": true
}candl answers with url, a short mycandl.com/f/… link when you send "short": true, and fullUrl, the long one.
- Forms
- Only a form that opens without signing in gives a personal link. Otherwise candl answers
403withportalUrl, the sign-in address to send instead. A household form needsmemberCode; every other form needsstudentId. - Report links
{"kind": "report", "code": "the 12 characters after /r/", "studentId": "12345"}. Only report links you shared. Someone who is not one of its readers is a404; an expired or taken-down link is a410.
More you can add
A send can carry more than the campaign and recipient. Some need a permission on the key; candl grays those out in the steps until it is on.
| To | Add | Where | Needs |
|---|---|---|---|
| Fill a merge tag | "firstName": "Levi" | in vars | |
| Use its own subject | "subjectOverride": "…" | in vars | |
| Add a Cc | "ccOverride": "office@…" | in vars | |
| Say where replies go | "replyToOverride": "…" | in vars | |
| File it under a Gmail label | "gmailLabel": "Transport/Passes" | in vars | |
| Attach a calendar invite | "event": {"title", "start", "end", "location"} | next to campaign | |
| Check there is an email first | "requireAddress": "report" or "check": true | next to campaign | Check there’s an email on file first |
| Attach files | "attachments": "Files/Invite_123.pdf" | next to campaign | Attach files (how) |
| Choose parents or student | "sendTo": "Students" | next to campaign | Choose parents or student |
| Add a hidden copy | "bccOverride": "…" | in vars | Add a hidden copy |
| Change the sender name | "senderNameOverride": "…" | in vars | Change the sender |
| Write its own email | leave out campaign; "message": "…" | in vars | Write its own email |
A tag like {{fatherCell}} inside text the app sends (a subject, a Cc) is filled only from the app’s own vars, never from the student record.
Send a file the app made
An app can make a file, such as a PDF, and have candl attach it to the email. candl does not receive the file in the request. It is given the file’s name or address and fetches it itself a minute or two later, when it sends. So the file must already exist, and candl must be able to open it, when the email goes out.
Example: a PDF made by AppSheet
- In AppSheet, have the bot create the file first and save it in a Google Drive folder the key’s owner can open. Note the folder name and the file name it gives it.
- In candl, open the app in Settings, Connected apps and turn on Attach files. It is off for new keys.
- In the send step, add
"attachments"next tocampaign, naming the file by its folder and name, like"Interviews/Levi_Cohen_Interview.pdf". Build it from the same columns AppSheet used to name the file. - Add the send as a later step in the same bot, after the file step, so the file is there first.
What you can put in attachments
- A folder and file name
Interviews/Report.pdf. candl looks for a Drive folder with that name (the one right before the file) and the exact file name inside it. If it does not find it there, it searches the whole of Drive for a file with that name and uses the first one it finds, so keep the names unique. Spaces in the name are fine. The file is found as the key’s owner, so it must be in a place the owner can open.- A Google Drive file ID
- The long ID from the file’s link, with no slash.
- A link
- Only an
httpslink on a site an administrator has approved. candl fetches it at send time, with no sign-in, and does not follow redirects. A link that has expired or is not on the list makes the send fail, and the failure is logged with the reason. - Several files
- Separate them with commas or semicolons.
Report.xlsx, is never found: give the folder too. Test one first. A link that cannot be fetched is the opposite: the email does not go.What candl answers
| Code | Means |
|---|---|
202 | A send was accepted. queued is its ID. The email goes out within about a minute. |
200 | A lookup or link answer, a check, or a send with "requireAddress": "report" that sent nothing (ok is false and reason says why). |
400 | Something in the body is wrong, such as an address that is not an address. The answer says what. |
401 | The key is wrong or missing. Check the header. |
403 | The key is off, has expired, or is not allowed this campaign or this kind of request. |
422 | Only with "requireAddress": true: the email would reach nobody, so nothing was queued. |
429 | The key reached its daily limit. |
502 | candl could not save the request. Nothing was queued. Try again. |
503 | candl could not be asked just now. Nothing was queued. Try again. |
Change or turn off an app
Open the app in Settings, Connected apps. Each job is a card: Change opens it in place, and the buttons below add a job it does not do yet. The steps to set it up are there too, with the key hidden. The menu has New secret, Turn off and Delete. Only the key’s owner can change it; any administrator can turn it off or delete it.
When it does not work
- The app says it worked, but no email came
- The owner’s sending may be off: Settings, Connected apps, Your sending. Emails wait until it is on. Or the family has no email on file: add
"requireAddress"to find out. The body is not valid JSON- A quote or line break inside a value you inserted. In AppSheet, write text inside an expression in single quotes.
- The email came with no attachment
- candl could not find the file in Drive when it sent, and skips a missing Drive file without telling the app. Open the log entry (above): Not attached names the file and why. Check that the file step ran first, that the name matches exactly, and that the key’s owner can open it.
403 This key may not attach filesmeans Attach files is off for the key. See Send a file the app made. - A lookup answers
found: false - The number is wrong, or the person is outside what the key’s owner can see in candl.
403 This key may not …- Turn on that job or permission for the key, or add the campaign to it.
- A form link answers
403withportalUrl - The form does not open without signing in. Turn on no-login links for it, or send the
portalUrladdress, which asks the family to sign in. - A link answers
400 Send studentId - Every form needs
studentId, except a household form, which needsmemberCode.