2017-08-14 16 views
0

私はこのリンクを使用して作業しています https://github.com/dwyl/html-form-send-email-via-google-script-without-serverただし、ポイント11を介してすることはできません - JSON応答/警告。Google Appsメールを使用して静的HTMLフォームから電子メールを送信

私はGoogleオンラインと話をしており、ここで私を紹介してくれました。私はブートストラップでそれを使用しています - 私のコードは以下の通りです。どんなアイデアも素晴らしいでしょう。上記のコード行で

<section class="test"> 
<a name="index"></a> 
    <div class="container"> 
    <div class="row index_section"> 
     <div class="col-md-10 col-md-push-1"> 
     <h2 class="index_h2">The RE Ledger Foundation is a consortium of east coast real estate and financial services executives with the purpose of exploring the applications and advantages of harnessing a blockchain backed peer-to-peer network.</h2> 
     <p><a class="btn btn-secondary btn-lg index_button" role="button" href="#contact" data-toggle="modal" >Contact Us</a></p> 
     </div> 
    </div> 
    </div> 

</section> 
<div class="modal fade" id="contact" role="dialogue"> 
    <div class="modal-dialog"> 
     <div class="modal-content"> 
     <form class="form-horizontal" method="POST" action="https://script.google.com/a/macros/headlandholdings.co/s/AKfycbyA1uVrYJK3dowguYNKo65hPfQKLGCFh8_865dFMhXzfE__Io8/exec"> 
      <div class="modal-header"> 
      <h4>Contact RE Ledger</h4> 
      </div> 
      <div class="modal-body"> 

      <div class="form-group"><!-- For every row --> 
       <label for="Contact-name" class="col-lg-2 control-label"> Name: </label> 
       <div class="col-lg-10"> 

       <input type="text" class="form-control" id="contact-name" name="contact-name" placeholder="Please put your full name"> 
       </div> 
      </div> 

      <div class="form-group"><!-- For every row --> 
       <label for="contact-email" class="col-lg-2 control-label"> Email: </label> 
       <div class="col-lg-10"> 

       <input type="email" class="form-control" id="contact-email" name="contact-email" placeholder="[email protected]"> 
       </div> 
      </div> 

      <div class="form-group"><!-- For every row --> 
       <label for="contact-message" class="col-lg-2 control-label"> Message: </label> 
       <div class="col-lg-10"> 

       <textarea type= "text" name="message" rows="8" class="form-control"> </textarea> 
       </div> 
      </div> 

      <div class="modal-footer"> 
       <a href="#index" class="btn btn-default" data-dismiss="modal">Close it</a> 
       <button class="btn btn-primary" type="submit"> Submit</button> 
      </div> 
      <div style="display:none;" id="thankyou_message"> 
       <h2><em>Thanks</em> for contacting us!</h2> 
      </div> 
      </div> 
     </form> 
     </div> 
    </div> 
    </div> 

</div><!-- /.container --> 

<!-- Included so that when you complete a contact request you get a message --> 
<script data-cfasync="false" type="text/javascript" 
src="https://cdn.rawgit.com/dwyl/html-form-send-email-via-google-script-without-server/master/form-submission-handler.js"></script> 
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
<!-- Include all compiled plugins (below), or include individual files as needed --> 
<script src="js/bootstrap.js"></script> 

答えて

0
<form class="form-horizontal" method="POST" action="https://script.google.com/a/macros/headlandholdings.co/s/AKfycbyA1uVrYJK3dowguYNKo65hPfQKLGCFh8_865dFMhXzfE__Io8/exec"> 

action=とGoogleによって提供されたリンクを参照すべきです。あなたが提供したギブスリンクのポイント5に、deploy web appの後にリンクが必要です。サンプルコードの代わりにそのリンクを使用してください。

あなたのためのヒント:ご理解いただけるコードをコピーしてください。

+0

こんにちは働いていた - あなたはそれがないと思わせる何か - それは正しい生成されたリンクですが?あなたがそのgithub投稿の所有者ではなく、SAME Googleアカウントを共有している場合、このメッセージは – Otis

+0

@Otisであることを確認しています。同じリンクを生成することはできません。確認のための手順をたどると、同じリンクも生成されませんでした。 Webアプリケーションとしてデプロイすると、OWN Webアプリケーションがデプロイされ、OWNリンクが生成されます。 – Tim1234

+0

これは私が作成したリンクが私に属していることです。これはhttps://cloud.githubusercontent.com/assets/194400/10560470/e2d7fcb6-7503-11e5-9d9a-3771423e51fa.pngとは異なります – Otis

0

[OK] - これは時代遅れですが、わかりました。まず第一に、Githubのリンクを他のものではなく上部で使用してください。それは簡単ではありません。

JSON/Ajaxの問題は、例のGoogleシートとは異なるモーダルを使用しようとしていたことでした。重要なのは、あなたの個人的に生成された電子メールアドレスリンクのどこにid = "gforms"行が挿入されているかです。

次に、インデックスの例をgithubから取り出し、すべての名前データを体系的に移動しました。それは面倒だが、それは

<div class="modal fade" id="contact" role="dialogue"> 
    <div class="modal-dialog"> 
     <div class="modal-content"> 
     <form id="gform" class="form-horizontal" method="POST" action="--- YOUR LINK HERE ---"> 

      <div class="modal-header"> 
      <h4>Contact RE Ledger</h4> 
      </div> 

      <div class="modal-body"> 




      <fieldset class="form-group"> 
       <label for="name" class="col-lg-2 control-label">Name: </label> 
       <div class="col-lg-10"> 
       <input type="text" class="form-control" id="name" name="name" placeholder="Please put your full name" /> 
      </fieldset> 

      <fieldset class="form-group"> 
       <label for="email" class="col-lg-2 control-label">Email: </label> 
       <div class="col-lg-10"> 
       <input type="email" class="form-control" id="email" name="email" value="" required placeholder="[email protected]"/> 
      </fieldset> 

      <fieldset class="form-group"> 
       <label for="message" class="col-lg-2 control-label">Message: </label> 
       <div class="col-lg-10"> 
       <textarea type= "text" id="message" name="message" rows="8" class="form-control"></textarea> 
      </fieldset> 

      <div class="modal-footer"> 
       <a href="#index" class="btn btn-default" data-dismiss="modal">Close it</a> 
       <button class="btn btn-primary" type="submit"> Submit</button> 
      </div> 


      </div> 
     </form> 
     <!-- Customise the Thankyou Message People See when they submit the form: --> 

     <div style="display:none;" id="thankyou_message"> 
      <h2 class='col-lg-10 model_message'> Thanks for your message - We will get back to you soon</h2> 
     </div> 

     </div> 
    </div> 
    </div> 






</div><!-- /.container --> 

<!-- Included so that when you complete a contact request you get a message --> 
<script data-cfasync="false" type="text/javascript" 
src="https://cdn.rawgit.com/dwyl/html-form-send-email-via-google-script-without-server/master/form-submission-handler.js"></script> 
関連する問題