กรอกGoogle Formแล้วสรุปเป็นPDF+ส่งเข้าเมล์+แจ้งผ่านLine

วันนี้มาทำ Workshop ที่เมื่อมีคนมากรอก Google Form จะนำข้อมูลจาก Form สรุปเป็นไฟล์PDFส่งเข้าอีเมล์ผู้กรอก และแจ้งเตือนการส่งข้อมูลดังกล่าวผ่าน Line Notify กันนะครับ 🙂 🙂 🙂

// Presented by BrilliantPy.com
 
function sendLineNotify() {
   
    // Editable
    var form = FormApp.openById('11Vl5RpalZ6IWdquI9CeXRrlrxmhTIPO-11Vl5RpalZ6'); 
    var tokens = ['WNFKVX1uXhfAqwLCIPxHiAWNFKVX1uXhfAqwLCIPxHiA']; // For 1 line group
    //var tokens = ['WNFKVX1uXhfAqwLCIPxHiAWNFKVX1uXhfAqwLCIPxHiA','WNFKVX1uXhfAqwLCIPxHiAWNFKVX1uXhfAqwLCIPxHiA']; // For multiple line groups
    var nameSenderColumn = "E-mail" 
    var mcontent = "ส่งข้อมูลสำเร็จ"

    // Init
    var form_res = form.getResponses()
    var formResponse = form_res[form_res.length - 1];
    var itemResponses = formResponse.getItemResponses();
     
    // Param
    var msgSend = "";
    var sender = ""
     
    for (var i = 0; i < itemResponses.length; i++) 
    {
      if ( itemResponses[i].getItem().getTitle() == nameSenderColumn) {
        sender = itemResponses[i].getResponse();
      }
    }

    // Editable: Format content
    msgSend = sender + " : " + mcontent
    // console.log(msgSend);
    
    for (var k = 0; k < tokens.length; k++) {

        var formData = {
          "message" : msgSend,  
        }
        
        var options = {
          "method" : "post",
          "payload" : formData,
          "headers" : {"Authorization" : "Bearer " + tokens[k]}
        };
        UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options);
    }
  }

119 thoughts on “กรอกGoogle Formแล้วสรุปเป็นPDF+ส่งเข้าเมล์+แจ้งผ่านLine

  1. visit their website says:

    I as well as my friends were actually looking at the nice helpful hints from your web page and then suddenly I got an awful feeling I never expressed respect to the blog owner for those techniques. These ladies are actually as a consequence excited to study all of them and have sincerely been taking pleasure in those things. Many thanks for truly being simply helpful and for having varieties of smart things most people are really desperate to know about. My personal sincere apologies for not expressing appreciation to sooner.

  2. Poodle says:

    Youre so cool! I dont suppose Ive read anything like this before. So nice to find somebody with some original thoughts on this subject. realy thank you for starting this up. this website is something that is needed on the web, someone with a little originality. useful job for bringing something new to the internet!

  3. Giá mèo lông ngắn anh thuần chủng says:

    An impressive share, I just given this onto a colleague who was doing a little analysis on this. And he in fact bought me breakfast because I found it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love reading more on this topic. If possible, as you become expertise, would you mind updating your blog with more details? It is highly helpful for me. Big thumb up for this blog post!

  4. zoritoler imol says:

    I wanted to send you this very little note to help give many thanks over again for all the splendid techniques you have contributed in this case. This is really wonderfully open-handed with people like you giving unreservedly what exactly a lot of people would have marketed as an ebook to generate some cash on their own, mostly considering that you might well have tried it in the event you considered necessary. The concepts as well worked to be the easy way to recognize that most people have a similar dreams just as my own to see many more when it comes to this matter. I am certain there are numerous more fun periods in the future for folks who scan your blog.

  5. Giống Shiba says:

    My wife and i felt quite happy when Jordan could complete his basic research from your precious recommendations he came across from your very own web pages. It’s not at all simplistic to just always be giving out concepts which other people could have been making money from. And we also do understand we have got you to appreciate for this. The specific illustrations you made, the easy site navigation, the relationships you can give support to create – it’s all impressive, and it is aiding our son in addition to the family reckon that this theme is fun, and that’s quite vital. Thanks for everything!

  6. Siba inu Nhật Bản says:

    I am commenting to let you understand of the fabulous encounter my friend’s daughter went through going through your site. She noticed some issues, which included what it’s like to possess a very effective teaching character to let many others clearly master various tortuous subject areas. You truly exceeded readers’ expectations. Thanks for presenting such valuable, safe, edifying and also easy tips on your topic to Ethel.

  7. đất sạch trồng rau says:

    Thank you for sharing superb informations. Your web-site is very cool. I am impressed by the details that you’ve on this website. It reveals how nicely you perceive this subject. Bookmarked this web page, will come back for more articles. You, my friend, ROCK! I found just the info I already searched all over the place and simply couldn’t come across. What a perfect web-site.

  8. Top Places to Adventure in Shengzhou (China) says:

    I wish to show some appreciation to this writer just for rescuing me from such a circumstance. After surfing throughout the internet and finding notions that were not pleasant, I figured my entire life was well over. Existing minus the approaches to the problems you’ve solved as a result of this write-up is a critical case, as well as those that would have adversely affected my entire career if I had not encountered your site. That natural talent and kindness in controlling all the things was vital. I’m not sure what I would have done if I had not come upon such a subject like this. It’s possible to now look ahead to my future. Thanks for your time very much for this specialized and result oriented help. I will not hesitate to endorse your web page to anybody who will need care about this problem.

ใส่ความเห็น

อีเมลของคุณจะไม่แสดงให้คนอื่นเห็น ช่องข้อมูลจำเป็นถูกทำเครื่องหมาย *