Skip to content

Instantly share code, notes, and snippets.

@CleanShavenApps
Last active August 27, 2022 20:50
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save CleanShavenApps/8206141 to your computer and use it in GitHub Desktop.
Save CleanShavenApps/8206141 to your computer and use it in GitHub Desktop.
/compose URL scheme for Dispatch mail app (www.dispatchapp.net)

Dispatch registers the x-dispatch:// URL scheme and provides one public action: compose.

/compose overview

Launches Dispatch with the composer screen prefilled using information provided in the parameters below.

from

Optional. Specifies the email address of the account to compose the new mail from. If there are more than one account configured in Dispatch, and no valid from account is provided, Dispatch will default to using the first account configured in Dispatch to compose the mail.

subject

Optional. Specifies the subject of the email.

body

Optional. Specifies the plain text body of the email.

to

Optional. Comma-separated list of email addresses to be populated in the 'To:' field of the email.

cc

Optional. Comma-separated list of email addresses to be populated in the 'Cc:' field of the email.

bcc

Optional. Comma-separated list of email addresses to be populated in the 'Bcc:' field of the email.

Example

The following URL is broken up with line breaks to illustrate the parameters.

x-dispatch:///compose?
from=hello@dispatchapp.net
&subject=Hello%20from%20Dispatch
&to=test@cleanshavenapps.com,random@dispatchapp.net
&cc=cc@cleanshavenapps.com
&body=Hello%20world%2C%0A%0AThis%20is%20an%20email%20composed%20with%20the%20Dispatch%20%2Fcompose%20URL%20scheme.%0A%0A%E2%80%94%20Dispatch

Note

Please take note of the triple /// in x-dispatch:///compose when using the URL scheme.

x-callback-url

Dispatch now supports the x-callback-url protocol developed by Greg Pierce. All x-callback-url parameters are optional. Fill up at least x-success if you want Dispatch to offer to return you to x-source.

x-source

Optional. A friendly name for the app making the call.

x-success

Optional. The URL to use to return the user to the calling application if the user sends the mail. This does not guarantee that the mail has been sent; it only means that the user has followed through the composing process and tap on Send.

x-cancel

Optional. The URL to use to return the user to the calling application if the user cancels the composing process. If not provided, Dispatch will call the URL in x-success instead.

Usage Example

Check out some x-callback kungfu by https://twitter.com/hiilppp/ to compose in Drafts, send to Dispatch, attach Dropbox file, send and return.

If you've more x-callback kungfu to share, please email support@dispatchapp.net.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment