Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jhasenklein

    (@jhasenklein)

    Hi,

    Whats up there now is a a Google Form. I created a custom script on the spreadsheet that sends a confirmation email to me and then sender. Still not sure why none of the plugins are working…but thanks…

    FYI–here is the Google Script for the notifications:

    /* Send Confirmation Email with Google Forms */

    //TRIGGERS WHEN THERE IS A NEW FORM RESPONSE

    function Initialize() {

    var triggers = ScriptApp.getProjectTriggers();

    for (var i in triggers) {
    ScriptApp.deleteTrigger(triggers[i]);
    }

    ScriptApp.newTrigger(“SendConfirmationMail”)
    .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())
    .onFormSubmit()
    .create();

    }

    //BEGINS COMPOSING THE EMAIL

    function SendConfirmationMail(e) {

    try {

    var ss, cc, sendername, subject, columns; //DO NOT CHANGE “CC” TO “BCC” (IT WON’T WORK!)
    var message, value, textbody, sender;

    cc = “[email protected]”; //EMAIL THAT WILL BE CC’D ON THE CONFIRMATION TO THE USER

    // SENDER NAME FOR THE EMAIL
    sendername = “Team 1836: Milken Knights”;

    //SUBJECT FOR THE EMAIL
    subject = “Thanks for contacting Team 1836!”;

    //BODY FOR THE EMAIL
    message = “Thank you for submitting the contact form! A team member has recieved your information and will get back to you soon.

    In the mean time, stay up to date with us:
    Website: milkenknights.com
    Facebook: fb.com/TheMilkenKnights
    Twitter: @milkenknights

    Thanks!
    Team 1836

    Here’s the data submitted on the form:

    “;

    ss = SpreadsheetApp.getActiveSheet();
    columns = ss.getRange(1, 1, 1, ss.getLastColumn()).getValues()[0];

    //SUBMITTED EMAIL ADDRESS
    sender = e.namedValues[“Email Address”].toString();

    // DOES NOT INCLUDE BLANK VALUES
    for (var keys in columns) {
    var key = columns[keys];
    var val = e.namedValues[key] ? e.namedValues[key].toString() : “”;
    if (val !== “”) {
    message += key + ‘ :: ‘ + val + “
    “;
    }
    }
    //USE
    FOR LINE BREAKS. GOOGLE WILL CONVERT TO \N
    textbody = message.replace(“
    “, “\n”);

    //SEND EMAIL
    GmailApp.sendEmail(sender, subject, textbody, {
    cc: cc,
    name: sendername,
    htmlBody: message
    });

    } catch (e) {
    Logger.log(e.toString());
    }

    }

    Thread Starter jhasenklein

    (@jhasenklein)

    Hi Davmerit,

    I pasted the code into the page builder at milkenknights.com/contact. There’s a different plugin there now though.

    Thread Starter jhasenklein

    (@jhasenklein)

    Hi Takayuki Miyoshi,

    It appears that regardless of what contact form I use (I also tried Best Web Soft and Contact Form Builder) I run into some problem. Those other ones I can’t submit the form.

    I switched the twenty fifteen theme and still ran into the same problem with Contact Form 7 not generating a shortcode and the other plugins not submitting.

    I can’t seem to figure it out because it doesn’t seem like a problem with the plugins or the theme.

    Thoughts anyone?

    Thread Starter jhasenklein

    (@jhasenklein)

    Thanks for your response. I named it “Contact Us” and did save it. I created a second one just to test it and no shortcode there either.

    I followed all of the steps from the link and no luck.

    Two things so I can try to better help you:

    1) What is the attachment ID used in the form? (you can paste your form code here in a blockquote if you want).

    2) Please provide the code from your “Mail” tab.

Viewing 5 replies - 1 through 5 (of 5 total)