Skip to main content
Capabilities

Email

POST/client/open/mail/v1/send

Sends an email to one address, using an HTML template or plain text. This is a server-side endpoint and must be signed.

Content-Type: application/json

Request​

FieldRequiredDescription
appId / timestamp / nonce / signYesCommon signing parameters
toYesRecipient address; one recipient per request
templateCodeNoTemplate code: an app template you created in the console, or a built-in template below. With a template, subject and body come from the template
subjectNoSubject line. Recommended when not using a template
textNoPlain-text body; content is an alias
appNameNoApp name {app} used in templates, default 「应用通知」
variablesNoTemplate variables as a JSON object, e.g. {"orderNo": "P001", "amount": "99.00"}. A JSON string is also accepted
code / name / link / contentNoShortcuts for common variables; variables wins on conflicts
fromTitleNoSender display name. Use your app or brand name
appCodeNoApp to bill. When set, the email is charged

Templates​

In the console, go to Email → Templates to create, edit and disable templates per app, with live preview and test sends.

FeatureDetails
FormatHTML body + plain-text body (generated from HTML if left empty), sent as a multipart email
VariablesWrite {name} in the subject and body and pass values in variables; {app} becomes your app name
EscapingVariable values are HTML-escaped, so callers cannot inject markup
Safety<script>, <iframe>, <form>, event attributes and javascript: links are removed on save; HTML emails end with a "Sent by app via FoOTOo Cloud" line
PrecedenceFor the same templateCode: app template → platform template → built-in
ScopeApp templates apply to signed calls only

Example: custom template​

Assume you created order_paid in the console with the subject {app} order {orderNo} paid:

BODY=$(python3 -c '
import json, footoo_sign
print(json.dumps(footoo_sign.signed({
"to": "user@example.com",
"templateCode": "order_paid",
"variables": {"orderNo": "P202611170001", "amount": "99.00"},
"appCode": "<appCode>",
}, "ak_xxx", "<appSecret>"), ensure_ascii=False))')
curl -s -X POST https://cloud.ifootoo.com/client/open/mail/v1/send \
-H 'Content-Type: application/json' -d "$BODY"

variables is a nested object, so it is signed as compact JSON with sorted keys per the signing algorithm. The reference implementations handle this.

Built-in templates​

Template text is in Chinese.

templateCodeSubjectBody (meaning)Variables
verify_code{app} 验证码Your code is {code}, valid for 5 minutes. Ignore this email if you did not request it.code
welcome欢迎使用 {app}Hello {name}, your {app} account is ready.name
reset_password{app} 重置密码Use this link to reset your password within 30 minutes: {link}link
notify{app} 通知{content}content or text

A code that is neither an app template nor a built-in returns 不支持的邮件模板 (unsupported template). For English emails, create your own template in the console.

Notes​

  • HTML via templates. Sending subject + text directly produces plain text; use a template for HTML.
  • Price: CNY 0.01 per email, deducted from the appCode balance before sending and refunded if sending fails.
  • Sender address: provided by the platform; customize the display name with fromTitle.
  • Delivery: success means the mail server accepted the message, not that it reached the inbox.

Example​

BODY=$(python3 -c '
import json, footoo_sign
print(json.dumps(footoo_sign.signed({
"to": "user@example.com",
"subject": "Your Acme verification code",
"text": "Your code is 482913. It expires in 5 minutes.",
"fromTitle": "Acme",
"appCode": "<appCode>",
}, "ak_xxx", "<appSecret>"), ensure_ascii=False))')
curl -s -X POST https://cloud.ifootoo.com/client/open/mail/v1/send \
-H 'Content-Type: application/json' -d "$BODY"

Success:

{"code":200,"msg":"邮件已受理","type":"SUCCESS","data":{"to":"user@example.com"}}
Apps without a backend

To email the signed-in user from a frontend-only app, use mail/self in Session capabilities. Your appSecret never reaches the browser.