Service Action Steps

Table of Contents

  1. File
  2. Twitter
  3. Dropbox
  4. Evernote
  5. WordPress
  6. Google Drive
  7. Box
  8. Gmail
  9. OneDrive
  10. OneNote
  11. Outlook
  12. Todoist
  13. WebDAV

File

Create or modify files in the iCloud Drive “Drafts” folder or local storage. It is not possible to modify files outside the app’s iCloud Drive folder.

Examples

Options

  • Name: Template for file name, including extension.
  • Path: Template for folder path, relative to root directory. For local files, this is the app “Documents” folder, for iCloud Drive it is the “Drafts” folder in iCloud Drive.
  • Template: Template for the content of the file.
  • Write Type:
    • create: Create a new file. If an existing file already exists at the location, create as new file with a number suffix added.
    • replace: Create new file, overwriting an existing if it exists.
    • prepend: Prepend template content at the beginning of the file. Create the file if it does not already exist.
    • append: Append template content at the end of the file. Create the file if it does not already exist.
  • Destination: Should the file be in app local storage or iCloud Drive.

Twitter

Post a tweet to Twitter. Use twitter steps with alternate identifiers to target multiple accounts.

Learn more in our Using Twitter with Drafts guide.

Examples

Options

  • Template: Template for the content of the file.
  • Identifier: Arbitrary string identifier for the Twitter credentials to use. This value is only needed if you wish to use more than one account with Drafts. If used, all actions with the same identifier will use the same alternate login for Twitter. The identifier can be any value, but something useful, like the twitter username, is helpful for identifying credentials in settings.

Dropbox

Create, append or prepend to files in Dropbox. For more information about using Dropbox with Drafts, see our Dropbox integration guide, which covers more advanced scripted actions and API usage.

Learn more in our Using Dropbox with Drafts guide.

Examples

Options

  • Name: Template for file name, including extension.
  • Path: Path of folder, relative to Dropbox root, to place file. Default “/” is the root of your Dropbox folder.
  • Template: Template for the content of the file.
  • Write Type:
    • create: Create a new file. If an existing file already exists at the location, create as new file with a number suffix added.
    • replace: Create new file, overwriting an existing if it exists.
    • prepend: Prepend template content at the beginning of the file. Create the file if it does not already exist.
    • append: Append template content at the end of the file. Create the file if it does not already exist.
  • Identifier: A string identifier for the Dropbox account to use. This value is only needed if you wish to use more than one Dropbox account with Drafts. If used, all actions with the same identifier will use the same alternate login for Dropbox.

Evernote

Create, append or prepend to notes in Evernote.

Learn more in our Using Evernote with Drafts guide.

Examples

Options

  • Note: Template for note name.
  • Notebook: Template for name of an existing Notebook in your Evernote account. Leave blank to use the default notebook.
  • Tags: Template for tags to assign the note. Should be comma-delimited list of tags. If they do not exist, they will be created. Use the [[tags]] template tag to assign draft tags.
  • Template: Template for the content of the note.
  • Template Output Format: The type of output from the above template property. Evernote uses it’s own HTML-like ENML markup for notes and conversion needs to be done before saving. This setting determines how Drafts will apply conversion. Options are:
    • Text: Assume the output of the template plain text. Drafts will convert the plain text to ENML by adding line feed tags.
    • Markdown: Assume the template output is Markdown. If you want Markdown syntax to be converted to rich-text in Evernote, choose “Markdown”. Drafts will take the output of the template and run it through the Markdown processor to convert to X-HTML before sending to Evernote.
    • ENML: Assume the output of the template is already valid ENML. This is an advanced setting for cases where scripting or special output is already configured with the necessary valid ENML tags.
  • Write Type:
    • create: Create a new note.
    • replace: Create new note, overwriting an existing one with the same name, if it exists.
    • prepend: Prepend template content at the beginning of the note. Create the note if it does not already exist.
    • append: Append template content at the end of the note. Create the note if it does not already exist.

WordPress

Post to a WordPress site. This action relies on the WordPress XML-RPC API, which is active by default on most newer WordPress installations, but may be subject to rate limits or blocking on some hosts.

Learn more in our Using WordPress with Drafts guide.

Examples

Options

  • Credential Identifier: A friendly name for the associated credentials used for this action. The first time the action is run, the user will be prompted to enter the WordPress site home page URL, and their username/password. This information will be stored for future use and can be reset in Settings > Credentials. If you only post to one WordPress site, leave this blank. If you post to more than one site, each WordPress action with the same credential identifier will share the same credentials.

  • Post Title: Template for post title.
  • Post Content: Template for content of the post.
  • Post Status: Status of the post once it is created. Default is “Draft”.
  • Post Format: Default “Standard”.
  • Categories: Comma-delimited list of categories to assign to the post. If the category does not already exist it will be created.
  • Tags: Comma-delimited list of tags to assign to the post. If the tag does not exist it will be created.
  • Post Slug: Optional URL slug for the post. The result of this field will be URL encoded.
  • Excerpt: Optional shorter excerpt to display in blog listing.
  • Custom Fields: The step can also accept two named custom fields and values. If used, the name of the custom fields should match ones which already have already been created in your WordPress site.

Google Drive

Create, append or prepend to files in Google Drive.

Examples

Options

  • Name: Template for file name, including extension.
  • Parent: Leave blank for root level of Google Drive, or include the name of a folder in the root level of Google Drive. The folder will be created when the action is run if it does not already exist.
  • Template: Template for the content of the file.
  • Template Output Format: The above template should be assumed to output text in the format selected here. Options are:
    • Text: The template outputs plain text. No further processing will be done.
    • Markdown: The template outputs Markdown and should be converted to HTML by the Markdown processor.
    • HTML: The template outputs fully formed HTML. This allows style and formatting information to be included to control output. Useful when combined with Upload Type parameter to create formatted Docs or PDFs.
  • Write Type:
    • create: Create a new file. If an existing file already exists at the location, create as new file with a number suffix added.
    • replace: Create new file, overwriting an existing if it exists.
    • prepend: Prepend template content at the beginning of the file. Create the file if it does not already exist. Only valid for Upload Type = Text.
    • append: Append template content at the end of the file. Create the file if it does not already exist. Only valid for Upload Type = Text.
  • Upload Type: This is used as a hint to tell Google Drive to convert the uploaded content to this type of file after upload. Combined with HTML input, this allow detailed control of uploaded documents.
  • Credential Identifier: A string identifier for the Google Drive account to use. This value is only needed if you wish to use more than one account with Drafts. If used, all actions with the same identifier will use the same alternate login for Google Drive.

Box

Create, append or prepend to files in the Box.com service. Note that more advanced Box actions can also be scripted with Box scripting support.

Examples

Options

  • Name: Template for file name, including extension.
  • Path: Path of folder, relative to Box.com account root, to place file. Default “/” is the root of your Box.com folder. Should begin with “/”
  • Template: Template for the content of the file.
  • Write Type:
    • create: Create a new file. If an existing file already exists at the location, create as new file with a number suffix added.
    • replace: Create new file, overwriting an existing if it exists.
    • prepend: Prepend template content at the beginning of the file. Create the file if it does not already exist.
    • append: Append template content at the end of the file. Create the file if it does not already exist.
  • Identifier: A string identifier for the OneDrive account to use. This value is only needed if you wish to use more than one Box.com account with Drafts. If used, all actions with the same identifier will use the same alternate login for OneDrive.

Gmail

Send pre-configured email messages in the background using Google Gmail and GSuite accounts. This step sends mail using the Gmail API.

Lwarn more in our [Sending Mail with Drafts[(https://forums.getdrafts.com/t/sending-mail-with-drafts/3597) guide.

Examples

Options

  • Recipients: Comma separated list of recipient emails for each of the recipient types. These can be just email address, or Name <email> formatted - like “Joe Smith joe@smith.com, Jane Doe jane@doe.com”.
    • To
    • CC
    • BCC
  • Subject: Template for the subject line.
  • Body: Template for content of the message. If “Send as HTML” is enabled, this template is expected to output valid HTML, otherwise plain text.
  • From: Usually left blank, but can be included to override Gmail’s default “From” value, in the format Name <email>
  • Send as HTML: If enabled, the mail is sent as formatted HTML email and the body template should output fully formed HTML. The most common use of this option is to run Markdown to HTML conversion to get rich-text mail. In this case the simple template “%%[[body]]%%” can be used.
  • Credential Identifier: A string identifier for the Gmail account to use. This value is only needed if you wish to use more than one account with Drafts. If used, all actions with the same identifier will use the same alternate login for Gmail.

OneDrive

Create, append or prepend to files in Microsoft’s OneDrive service. Note that more advanced OneDrive actions can also be scripted with the OneDrive scripting support.

Examples

Options

  • Name: Template for file name, including extension.
  • Path: Path of folder, relative to OneDrive root, to place file. Default “/” is the root of your OneDrive folder. Should begin with “/”
  • Template: Template for the content of the file.
  • Write Type:
    • create: Create a new file. If an existing file already exists at the location, create as new file with a number suffix added.
    • replace: Create new file, overwriting an existing if it exists.
    • prepend: Prepend template content at the beginning of the file. Create the file if it does not already exist.
    • append: Append template content at the end of the file. Create the file if it does not already exist.
  • Identifier: A string identifier for the OneDrive account to use. This value is only needed if you wish to use more than one OneDrive account with Drafts. If used, all actions with the same identifier will use the same alternate login for OneDrive.

OneNote

Create, append or prepend to notes in Microsoft’s OneNote service.

Examples

Options

  • Notebook: Template for notebook name. Should be exact match for existing notebook in your personal OneNote account, or leave blank to target the default notebook.
  • Section: Name of a section within the specified notebook. If the section does not exist, Drafts will created it.
  • Page: Title of page in the section specified above. If the page does not exist, Drafts will create it.
  • Template: Template for the content of the note.
  • Template Output Format: Determines how the output of the above template should be treated. Options:
    • Text: Assumes the output of the template is plain text, and converts it to HTML by converting HTML entities, and adding line breaks.
    • Markdown: Assumes the output of the template is raw Markdown, and runs it through the Markdown processor to convert it to HTML to upload.
    • HTML: Assumes the template outputs HTML. When using this, the template should not include <html>, <body> tags, just the content part of the HTML, in fully-valid X-HTML format (closing tags, quoted attributes) or OneNote will reject the content. Generating the correct HTML, it is possible to create special OneNote-specific items like tasks. Refer to OneNote data tag documentation.
  • Write Type:
    • create: Create a new note. If an existing file already exists at the location. If the page targetted already exists, fail with an error.
    • replace: Create new page, overwriting an existing if it exists.
    • prepend: Prepend template content at the beginning of the page. Create the page if it does not already exist.
    • append: Append template content at the end of the page. Create the page if it does not already exist.
  • Identifier: A string identifier for the OneNote account to use. This value is only needed if you wish to use more than one OneNote account with Drafts. If used, all actions with the same identifier will use the same alternate login for OneNote.

Outlook

Send pre-configured email messages in the background using Outlook.com/Live integrated accounts. Step integrates via Microsoft Graph API. The first time this step is used you will be asked to authenticate. To use multiple accounts, use different credential identifiers.

This step will work with any personal or work/school account enabled to work with Outlook.com/Live.

Lwarn more in our [Sending Mail with Drafts[(https://forums.getdrafts.com/t/sending-mail-with-drafts/3597) guide.

Examples

Options

  • Recipients: Comma separated list of recipient emails for each of the recipient types. These can be just email address, or Name <email> formatted - like “Joe Smith joe@smith.com, Jane Doe jane@doe.com”.
    • To
    • CC
    • BCC
  • Subject: Template for the subject line.
  • Body: Template for content of the message. If “Send as HTML” is enabled, this template is expected to output valid HTML, otherwise plain text.
  • Send as HTML: If enabled, the mail is sent as formatted HTML email and the body template should output fully formed HTML. The most common use of this option is to run Markdown to HTML conversion to get rich-text mail. In this case the simple template “%%[[body]]%%” can be used.
  • Credential Identifier: A string identifier for the Gmail account to use. This value is only needed if you wish to use more than one account with Drafts. If used, all actions with the same identifier will use the same alternate login for Gmail.

Todoist

Add a task to your inbox on the Todoist task management service. More advanced integration with Todoist is also available via the Todoist script object.

Learn more in our Using Todoist with Drafts guide.

Examples

Options

  • Template: Template for the content of the new task. Can contain Todoist quick task shorthand to specify project, priority, etc.
  • Reminder: Optional human-readable date specifier in a format Todoist understands, like “next Wednesday” or “Tomorrow”. If blank, no reminders will be assigned to the task.
  • Comment: Also optional, but if this template generates text, it will be added to the new task as a comment.
  • Identifier: Arbitrary string identifier for the Todoist credentials to use. This value is only needed if you wish to use more than one account with Drafts. If used, all actions with the same identifier will use the same alternate login for Todoist.

WebDAV

Create and modify files on a WebDAV enabled server.

Options

  • Account Identifier: A friendly name for the associated credentials used for this action. The first time the action is run, the user will be prompted to enter the WebDAV server URL, and their username/password for the connection. This information will be stored for future use and can be reset in Settings > Credentials. The identifier can be any short string, but should help identify the intended server - like possibly a fragment of the host name. All WebDAV actions with the same account identifier will use the same set of credentials, so use different identifiers to target different servers/accounts.
  • Name: Template for file name, including extension.
  • Path: Template for folder path, relative to root directory. For local files, this is the app “Documents” folder, for iCloud Drive it is the “Drafts 5” folder in iCloud Drive.
  • Template: Template for the content of the file.
  • Write Type:
    • create: Create a new file. If an existing file already exists at the location, create as new file with a number suffix added.
    • replace: Create new file, overwriting an existing if it exists.
    • prepend: Prepend template content at the beginning of the file. Create the file if it does not already exist.
    • append: Append template content at the end of the file. Create the file if it does not already exist.