Copy/Paste HTML Preview into Gmail!

Obsidian is AWESOME!!!

I just realized the HTML Preview can be copied/pasted into Gmail with all images, formatting, and background color!!


THANK YOU, OBSIDIAN!

Just bought a commercial license! :smiley:

5 Likes

And it copies the formatting from your current theme, so you can quickly switch themes before copying. I’m working on a custom theme just for emails!

1 Like

If the reverse is true, I can archive gmail messages to Obsdmd.

Any text editor that recognizes HTML will support copy/paste in this way: Google Docs, Microsoft Word, etc.

Hi @sam.baron,

I prefer typing my emails (and notes) in markdown so I can apply formatting as I type and not mess with the mouse. But yes, the copy/paste would work in other editors.

I like this solution because I can easily swap themes on the note before copying, and the css is easy to edit to create custom themes. I see a lot of automation potential once the API is released.

I wasn’t suggesting otherwise. I have the exact same workflow :smiley:.

Just making sure anyone who reads this topic knows that you can do more by copying/pasting HTML from preview mode besides write emails.

It would be great to have a future plugin that creates an email from a markdown note.

1 Like

YES! I’ve been thinking about this for a few days. This would be awesome!

We would also need a way to handle local images. The copy/paste HTML works on images when you use <img src="https:...> with a full URL, but images don’t copy with local links.

So you have the extra step of hosting images online first and gathering the links, or copying text only and inserting images in the Gmail editor after pasting.

@GreenFlux Please create a post in #plugins :smiley:

1 Like

Will do. Meeting starting soon. I’ll add a new post this afternoon. Thanks!

1 Like

Hi!
I’m a complete newbie to Obsidian, and was wondering how exactly you “open” the HTML preview for a note?

Cheers!

The ‘Form’ icon next to the Link button enters Preview Mode

Also, in the (…) menu to the right of the X, you can Split the view, and make one view for Edit Mode and one for Preview Mode.

Then, click the Link button in one version and select the other to sync scrolling.

I have an AHK that (kinda) does that… I blagged it from the ConnectedText forum. Credit to Manfred Keuhn

send e-mail directly from Obsidian @keuhnm

` & m:: ;send e-mail
Gui, Add, Edit, W300 vemail,
Gui, Add, Edit, W300 vsubject,
Gui, Add, Edit, W300 R20 vbody,
Gui, Add, Button, Default, Send
Gui, Show
Return,
ButtonSend:
Gui, Submit, NoHide
if email = Email
{
Return,
}
if message = Message
{
Return,
}
else
Run, mailto:%email%?subject=%Subject%&body=%body%
Gui destroy
return

1 Like

Is this functionality gone or no longer working?

If I’m working in Markdown or in Live Preview, when I view my page (or Preview it) and copy-paste into Gmail, the only thing getting copied is the Markdown.

I wrote a plugin exactly for this. It doesn’t use your Obsidian theme (I didn’t want my mails to be dark), but you can define your own CSS for copying to clipboard if needed.

You can find it as “Copy document as HTML” in the community plugins.

1 Like

Is there a way I can use your plugin (which I have) to copy just a snipped of bulleted notes in an Obsidian doc and paste that into an email?

I keep my notes sorted by day, and I want to just copy a portion (e.g., notes from one meeting today) and put them in a Gmail email and send it.

@aagha and for reference : sorry, I missed your reply. No this is not possible at the moment. I had this request a few times, but it seems quite complicated to do right. For instance, what should happen when the selection starts in the middle of a table ?

For reference, it is now possible to copy just a portion of a document to HTML.