Git Product home page Git Product logo

Comments (8)

maxwofford avatar maxwofford commented on July 19, 2024

This seems to work when I tested it on my own form:

function onFormSubmit(e) {
    var apiKey = 'YOUR API KEY';
    var mailgunServer = 'YOUR MAILGUN SERVER';
    var to = findResponse('First and last name') + ' <' + findResponse('Email') + '>';
    var from = 'Hack Camp Team <[email protected]>';
    var subject = 'Hack Camp applicaiton received - ' + findResponse('First and last name');
    var message = 'Hey ' + findResponse('First and last name') + ', your application to Hack Camp has just been received. We\'ll get back to you within x days';
    var url = 'https://api.mailgun.net/v3/' + mailgunServer + '/messages';
    var payload = {
        'from': from,
        'to': to,
        'subject': subject,
        'text': message
    };
    var headers = {
        'Authorization': 'Basic ' + Utilities.base64Encode(apiKey)
    }
    var options = {
        'method': 'POST',
        'headers': headers,
        'payload': payload,
        'muteHttpExceptions': false
    };
    var response = UrlFetchApp.fetch(url, options);
}

function findResponse (namedValue) {
    var formResponses = FormApp.getActiveForm().getResponses();
    var formResponse = formResponses[formResponses.length-1];
    var itemResponses = formResponse.getItemResponses();
    for (var j = 0; j < itemResponses.length; j++) {
        var itemResponse = itemResponses[j];
        if (itemResponse.getItem().getTitle() === namedValue)
            return itemResponse.getResponse();
    }
}

@andreadeng @jonleung What message would be good to send them?

from camp.

jonleung avatar jonleung commented on July 19, 2024

from camp.

andreadeng avatar andreadeng commented on July 19, 2024

Hi [Name of applicant],

We have received your application and will look over it carefully. We are doing admissions on a rolling basis and will get back to you by at least 2 weeks before the cohort starts. Let us know if you need to be notified earlier. Please feel free to reach out to us with questions!

Best,
[Sender Name]

from camp.

andreadeng avatar andreadeng commented on July 19, 2024

Hi Hacker,

We have received your application and will look over it carefully. We are doing admissions on a rolling basis and will get back to you by at least 2 weeks before the cohort starts. Let us know if you need to be notified earlier. Please feel free to reach out to us with questions!

Best,
hackEDU Team

from camp.

maxwofford avatar maxwofford commented on July 19, 2024

We're live:
screenshot 2015-07-09 at 3 28 47 pm

from camp.

zachlatta avatar zachlatta commented on July 19, 2024

I'll send a few small wording changes in a bit.

from camp.

maxwofford avatar maxwofford commented on July 19, 2024

@zachlatta You can make changes here

from camp.

zachlatta avatar zachlatta commented on July 19, 2024

Awesome! Went ahead and changed the text around a bit.

On Sun, Jul 12, 2015 at 3:01 PM, Max Wofford [email protected]
wrote:

@zachlatta https://github.com/zachlatta You can make changes here
https://script.google.com/macros/d/MdzQ1ey8oJtgIX6iWbbnHsPDp8aFBtR4M/edit?uiv=2&mid=ACjPJvFcI2Q9PdeiSYdsRn2SICrDyWmrTlEs9-LB7ZARB6_cUIV4ThC8biTAELAzO39IXDCrpr6H1jH_6PHli2KIa2qSLh0gPYbk6PnPE3MozInVO7_mrKXRLR1AxneF0c70BsLAsEBxo4U


Reply to this email directly or view it on GitHub
#46 (comment).

from camp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.