Ask your coding assistant to add Tawked Email to your project.
- A Tawked account with an application that has Email on. Sign up if you have none.
- Early access to Tawked Email. It is early access: open the application’s Email area in the console and apply with what you send, how much a month and your domain. Tawked’s team reviews each request and tells you on WhatsApp, in the console and by e-mail. Until it is approved, you cannot add a domain, and a send answers
403 email_early_access. - A domain you own, and access to its DNS.
1
Verify your domain
Open the application, then Email → Setup, and add your domain,
acme.sa for example. The console shows one TXT record:Add it at your DNS provider exactly as shown, with the whole value (about 400 characters; the console’s copy button copies all of it). It publishes the public half of the DKIM key Tawked made for your domain, which is what mail servers check. On Route 53 the value goes in as two quoted strings, since one string holds at most 255 characters. Tawked looks for the record every ten minutes; press Check now to look at once. A domain whose record is not found within 72 hours is marked failed, and you can add it again.Nothing else in your DNS changes: your MX records, your SPF record and your mailboxes stay as they are.
2
Create a live key
On Application settings → API keys, press Create a key. Choose the type Live, and under Access either All products or Custom with Email set to Send (the
email:send scope). Copy the key: it shows once. Put it in your server’s environment as TAWKED_KEY.A test key does not work here: the e-mail endpoints answer it 403 live_key_required. Send your first messages to your own address instead.3
Send a message
202 Accepted: the message is recorded and on its way.403 insufficient_scope (the key’s access does not include Email send), 403 email_early_access (the account has not been granted early access yet), 409 no_verified_domain (no domain of this application is verified yet), 422 sender_not_verified (the from address is on another domain). Sending email lists every code.To send to several people, give to as an array and add cc or bcc (up to 50 together): the answer then lists each recipient with its own status (see Recipients). To send many different messages at once, use a batch; to send later, add scheduled_at (Scheduling).Or send through SMTP. If your system can only send e-mail over SMTP (a CMS, a framework’s mailer, an older app), point it at Tawked instead of calling the API:The From address must be on your verified domain; one e-mail is one message, and each of its recipients one e-mail of the price. Sending over SMTP has the reply codes and setups for Laravel, WordPress and Nodemailer.
4
Send an attachment
An invoice or a ticket travels in The type is guessed from the file’s extension unless you send
attachments: up to 10 files, each with its filename and its bytes in base64 as content, 10 MiB together, at no extra price.content_type. Executables and scripts are refused with 422 attachment_type_blocked, and files over the limit with 422 attachments_too_large. Attachments has every field, including content_id to place an image inside the HTML.5
Read the status
status moves from accepted to sent and delivered as the receiving mailbox answers, or ends as bounced or failed with error set. The message is on Email → Messages too.6
Add the webhook
On Application settings → Webhooks, Add endpoint with your server’s URL and keep the Email events ticked:
email.delivered, email.bounced, email.complained and email.failed. Tawked then posts them as they happen, signed with that endpoint’s secret like every other event. See Webhooks for the signature and Sending email for the payload.