Deprecated: Return type of I::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 62

Deprecated: Return type of I::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 91

Deprecated: Return type of I::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 71

Deprecated: Return type of I::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 101

Deprecated: Return type of I::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/i.php on line 53

Deprecated: Return type of Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/public/kirby/toolkit/lib/collection.php on line 80

Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /home/public/kirby/toolkit/lib/url.php on line 135
One Tap Less | Markdown, Emails & LCP

Markdown, Emails & LCP


Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Warning: Trying to access array offset on value of type null in /home/public/kirby/vendors/parsedownextra.php on line 305

Deprecated: substr(): Passing null to parameter #2 ($offset) of type int is deprecated in /home/public/kirby/vendors/parsedownextra.php on line 305

Automatization is, most of the time, a personal matter. If the communication between two apps becomes widely used, it often indicates an issue with one of the parts. Knowing that, when Joe Kohlmann asked for a way to send markdown formatted emails from the clipboard, I couldn't just sit around and wait for a solution.

Drafts is not a great place to write anything with more than a few lines, specially if you compare with Scratch or Byword or anything with a markdown bar1.

So let's consider that you write a beautiful email in markdown in your favorite text editor and copy it to the clipboard. If you open Drafts in an empty document and try to activate an action, you'll get an error. You must paste the content first and that's two taps. As you know, I take taps very seriously.

What's the best app to create magic with the content of your clipboard? That's right, Launch Center Pro. We'll create a one-tap action to format a markdown email to html and send it with a few details.

We'll use two Launch Center Pro actions, one of them for short emails, with a single paragraph, which will hold recipients and the subject, besides the content of the email, and another for longer emails, with line breaks, which will hold only the recipients OR the subject plus the content. Let's begin with the LCP action for short emails:

drafts://x-callback-url/create?text={{[[clipboard]]}}&action=Markdown%20Short

This will create a Drafts document with the clipboard content and activate the rule Markdown Short, as it follows:

Markdown Short:

drafts://x-callback-url/create?text=[[line|3]]&action=Markdown%3A%20Copy%20to%20Clipboard&x-source=Drafts&x-success={{drafts://x-callback-url/create?text=[[line|1]]%0A[[line|2]]&action=Short%20Clipboard%20Mail&afterSuccess=Delete}}&afterSuccess=Delete

Beware of an inception of actions. This action will call the Markdown: Copy to Clipboard default action from Drafts, then it will create another document and activate our custom Short Clipboard Mail action.

Short Clipboard Mail:

launchpro-email://x-callback-url/?to=[[line|1]]&subject=[[line|2]]&body=[[clipboard]]

This last called action will trigger LCP again and place the first line as recipient, second line as subject and the clipboard as the email body. Yes, it works fast, Drafts never failed to call so many actions in a row. Poof, we're done. Next!

The aforementioned chain of actions rely on the recent [[line|#]] tag, so if our presumed text body has a single line break, it will be considered as a line and the following content as another. This is not really good since our Markdown: Copy to Clipboard action targets at the third line only. To solve this conundrum, we'll use our old friends [[title]] and [[body]]. First, add another action to LCP:

drafts://x-callback-url/create?text={{[[clipboard]]}}&action=Markdown%20Long

Afterwards, we'll begin with our chain of Drafts actions. You can assume how they work unless you skipped the whole article and just downloaded the actions (I don't mind if you do it though).

Markdown Long:

drafts://x-callback-url/create?text=[[body]]&action=Markdown%3A%20Copy%20to%20Clipboard&x-source=Drafts&x-success={{drafts://x-callback-url/create?text=[[title]]&action=Long%20Clipboard%20Mail&afterSuccess=Delete}}&afterSuccess=Delete

Long Clipboard Mail:

launchpro-email://x-callback-url/?to=[[draft]]&subject=&body=[[clipboard]]

This example has the [[title]] as the recipients, just because I find it easier to type a subject then a bunch of contacts, but if you'd prefer to have your subject there, just replace to from the Long Clipboard Mail action to subject. No, I won't do it for you. See ya next time.

UPDATE: If you decide to create an action with the [[title]] as subject instead of recipients, there's an easier way to do it with the mail actions from Drafts. Create the following Launch Center Pro action:

drafts://x-callback-url/create?text=[clipboard]&action=Markdown%20Email

And download this action: Markdown Email. It is a super simple mail action with content as [[body]], first line as subject and to be sent as markdown html.


  1. Drafts for iPad has a shortcut bar, just saying.