Jump to content

Link on Tumblr to automatically send emails

HI all, 

 

So I just set up a tumblr, and I want to have a link/button somewhere that, when you click it, it sends a formatted email to a given email address something like

Subject: <tumblr username> wants xyz
Body: this is a notification that <tumblr username> has clicked your link and, therefore wants xyz from you.

I'm sure something like this can be done in the wide world of HTML5 but I'm not sure how i'd go about it. I'd imagine I'd have to create an email address specifically to fire off these templated addresses. but that's trivial. The one thing I'm really stuck on is, how I could get a tumblr user's profile name (example if their link is https://xyz.tumblr.com I'd want it to grab "xyz" and plug it into the email.

 

Any ideas of how I'd impliment this?

Link to comment
Share on other sites

Link to post
Share on other sites

This is a really really really bad idea.

And also (thankfully) impossible. You cannot send email just from pure HTML you need access to a server-side language. The only way I can think of doing this would be to have an email server set-up. And use javascript to send an AJAX call to that server which responded by sending the email. I don't know if tumblr allows you to embed javascript into your page but it stands to reason it probably does.
 

HTML:

<button onclick="sendEmail()"></button>
JAVASCRIPT:

var sendEmail = function() {
  var params_string = ... //username etc goes here
  var http = new XMLHttpRequest();
  http.open('GET',"www.emailserver.com/api/email?"+params_string, true)
  http.send().then(function(response){
    ... //give feedback to user probably a good idea.
  })
}


I will warn you that this is a REALLY REALLY REALLY REALLY bad idea and needs proper implementation in the form of rate-limiting and only allowing users to send x emails each etc.
 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, dylan0150 said:

This is a really really really bad idea.

And also (thankfully) impossible. You cannot send email just from pure HTML you need access to a server-side language. The only way I can think of doing this would be to have an email server set-up. And use javascript to send an AJAX call to that server which responded by sending the email. I don't know if tumblr allows you to embed javascript into your page but it stands to reason it probably does.
 


HTML:

<button onclick="sendEmail()"></button>

JAVASCRIPT:

var sendEmail = function() {
  var params_string = ... //username etc goes here
  var http = new XMLHttpRequest();
  http.open('GET',"www.emailserver.com/api/email?"+params_string, true)
  http.send().then(function(response){
    ... //give feedback to user probably a good idea.
  })
}


I will warn you that this is a REALLY REALLY REALLY REALLY bad idea and needs proper implementation in the form of rate-limiting and only allowing users to send x emails each etc.
 

thanks much.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×