I don't have much web dev experience but I'm trying to add to my club's web app on p5.js editor. It's a photobooth application that takes your picture, adds a filter, and emails the picture to you. I need to do two things for our event in a few days.
- I need to send the picture to the user's email.
- I need to store email inputs in an online database.
Could anyone provide some JavaScript code and/or detailed instructions on how to go about this?
This is what I have so far but I honestly don't understand what's happening. I haven't figured out the picture attachment yet and I don't know if this format with mandrillapp allows JavaScript image attachments.
function sendMail() {
$.ajax({
type: 'POST',
url: 'https://mandrillapp.com/api/1.0/messages/send.json',
data: {
'key': '***************',
'message': {
'from_email': '*******@gmail.com',
'to': [
{
'email': '************@gmail.com',
'name': '*******',
'type': 'to'
}
],
'autotext': 'true',
'subject': 'Welcome to AI@UCI!',
'html': 'Thanks for joining our newsletter! Here is your image :)'
}
}
}).done(function(response) {
console.log(response);
});
}
Thank you.