Creating email: subject and body

Is possible to create an extension that by selecting the URL or any text of the webpage text automatically generates an email (with your default email app) and adds the link or text selected to the body of the message and adds as subject of the email the title of the webpage? (e.g., if it is an article, to display the name of the article in the subject)

If there is alternatively a Chrome extension for this, feel free to recommend.

Thank you!

Hiya – give thos one a try:

#popclip
name: Email Text
icon: symbol:mail
javascript: |
  let to = ''
  let subject = popclip.context.browserTitle.length > 0 ? popclip.context.browserTitle : 'Clipping'
  let body = popclip.input.text
  if (popclip.context.browserUrl.length > 0 ) {
     body += '\n' + popclip.context.browserUrl
  }
  popclip.openUrl(`mailto:${encodeURIComponent(to)}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`)

(The above block is an extension snippet - select it to install the extension with PopClip)

4 Likes

AWESOME!
THANKS a lot!

1 Like

Hey Nick!

How would one tweak that where we could just have the selected text be added to body of the email, and not the url itself. Subject line could be empty.

1 Like

Hey, the Email extension on the main extensions page will do that for you.

But as a snippet this is actually super easy. Since no processing needs to be done, we can use a URL extension:

#popclip
name: Email Text
url: mailto:?body=***