Home Download Buy Blog Forum Support

is there a SublimeGmail Plugin?

is there a SublimeGmail Plugin?

Postby rochacbruno on Fri Feb 17, 2012 4:59 am

Hi,

I always copy-paste code from sublime to paste in gmail when sending snippets to some user-lists, also sometimes I wrote code directly in the gmail editor.

I want to find (or develop) a plugin to write the email in SublimeText and then call "Gmail: send" on command pallete to send this..

may be the destination can be defined in the command pallete or as some comment in text, also the gmail credential should go in the plugin config file.

It is very easy to send emails using Python+Gmail, but I dont know exactly what I need to be able to do it from Sublime.

Does anybody implemented something like that?

thanks
rochacbruno
 
Posts: 3
Joined: Fri Feb 17, 2012 4:53 am

Re: is there a SublimeGmail Plugin?

Postby skaet on Fri Feb 17, 2012 8:36 am

While not out of the realm of possibility it's pretty unlikely to gain popular usage, making the effort of development too high.

A plugin of this type would require leveraging GMails OAuth API over IMAP/SMTP. To look into it I suggest starting with Google's own Python-based documentation. Naturally there's a security concern involved which makes me think it's better to look elsewhere or develop this privately where you have better control over its environment.
skaet
 
Posts: 93
Joined: Thu Sep 16, 2010 3:37 pm

Re: is there a SublimeGmail Plugin?

Postby rochacbruno on Tue Feb 21, 2012 8:29 pm

skaet wrote:While not out of the realm of possibility it's pretty unlikely to gain popular usage, making the effort of development too high.

A plugin of this type would require leveraging GMails OAuth API over IMAP/SMTP. To look into it I suggest starting with Google's own Python-based documentation. Naturally there's a security concern involved which makes me think it's better to look elsewhere or develop this privately where you have better control over its environment.


It is really easy to send emails using gmail and Python

Code: Select all
import smtplib 
 
fromaddr = 'fromuser@gmail.com' 
toaddrs  = 'touser@gmail.com' 
msg = 'There was a terrible error that occured and I wanted you to know!' 
 
# Credentials (if needed) 
username = 'username' 
password = 'password' 
 
# The actual mail send 
server = smtplib.SMTP('smtp.gmail.com:587') 
server.starttls() 
server.login(username,password) 
server.sendmail(fromaddr, toaddrs, msg) 
server.quit()


I just want to know how to use this as a sublime plugin.
rochacbruno
 
Posts: 3
Joined: Fri Feb 17, 2012 4:53 am

Re: is there a SublimeGmail Plugin?

Postby C0D312 on Tue Feb 21, 2012 8:55 pm

I'll make it for you but I won't be home for ~3-4 hours.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: is there a SublimeGmail Plugin?

Postby tanepiper on Thu Feb 23, 2012 6:57 pm

C0D312 wrote:I'll make it for you but I won't be home for ~3-4 hours.


Oh, it would be cool if you could email the current file as an attachment! Might make it useful
tanepiper
 
Posts: 68
Joined: Sun Nov 06, 2011 6:40 am

Re: is there a SublimeGmail Plugin?

Postby C0D312 on Thu Feb 23, 2012 8:41 pm

C0D312 wrote:I'll make it for you but I won't be home for ~3-4 hours.

whoops, forgot to do this. I'll get around to it, though.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: is there a SublimeGmail Plugin?

Postby rochacbruno on Wed Mar 07, 2012 12:45 am

I am trying here with no success.

Which methd I have to use to get selected text? self.view.sel() ?

I wanted to have this:

1. select a text block
2. Hit the ctrl+shift+G to open Gmail dialog (is it possible?)

Then in dialog I put subject, to, cc, bcc, and a checkbox if I want to include the file as attachment.

even if dialog is not possible, this can be setted in the text with special markup

{{G:to:cc:bcc:subject:True,False}}

Any idea?
rochacbruno
 
Posts: 3
Joined: Fri Feb 17, 2012 4:53 am

Re: is there a SublimeGmail Plugin?

Postby C0D312 on Wed Mar 07, 2012 12:48 am

self.view.substr(self.view.sel()[0]) gets you the currently selected text.

While you can't have a custom dialog box with multiple fields, you can use an input panel.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: is there a SublimeGmail Plugin?

Postby skarlso on Fri Jun 07, 2013 8:46 pm

Hey guys.

I don't know if this has been answered or not.. Or the guy sent around the plugin or whatever.

Here is the plugin that does JUST THAT.

Upon pressing ctrl+alt+g it opens up a small input panel where you can enter the destination address and send the selected text:

Google code: https://code.google.com/p/sublime-gmail-plugin/

Github: https://github.com/Skarlso/SublimeGmailPlugin

Hope that helped.
Cheers,
Skarlso
skarlso
 
Posts: 1
Joined: Fri Jun 07, 2013 8:39 pm

Re: is there a SublimeGmail Plugin?

Postby aim9x on Fri Nov 29, 2013 1:21 pm

Sorry to necropost but here goes:

I find this plugin very useful. I'd like to be able to add a input panel that allows you to customize/enter the subject line. How should I go about doing that?
aim9x
 
Posts: 3
Joined: Fri Nov 29, 2013 1:15 pm

Next

Return to Plugin Development

Who is online

Users browsing this forum: Exabot [Bot] and 5 guests