اذهب إلى المحتوى
  • 0

هل بالاستطاعه تغيير نوع الرساله فى apps Script and google-sheets

السؤال

استخدم جوجل شيت عند ارسال رساله نسيت كلمه السر الى البريد اريد تغيير الرساله حسب المطلوب 

اذا كان البريد فارغ 

اذا كان البريد غير صحيح او غير مسجل

اذا كان البريد مسلج تظهر رساله تم ارسال الرقم السرى الى البريد الاكترونى

النص المستخدم فى script.google

اقتباس

for (var i = 0; i < values.length; i++) {

  if (values[i][0] == email) {

    var name = values[i][1];

    var password = values[1][2];

    var message = 'Hello '+ name +' .\n\nYour password is: ' + password;

    var subject ='Forgot your password';

    var recipient = email;

   MailApp.sendEmail(recipient, subject, message);

  var found_record = '';

   break

 }

 }

if (found) {

return 'Welcome, '+name+ '\nPassword sent to email.';

 

} else {

return 'Email address not found, Try Again.';

}

}////////////////////////////////////////////////Forgot Password/

/**========================================= */

الكود المستخدم فى html 

اقتباس

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

 <div class="wrapper">

    <h2>Contact us</h2>

  <div id="error_message"></div>

<form  onsubmit="event.preventDefault(); submitForm(this);">

      <div class="input_field">

        <input type="text" placeholder="Email" id="email" name="email">

      </div>

 

      <div class="input_field">

<textarea placeholder="Message" id="result" name="message">TryAgain</textarea>

<!-- <textarea  id="result" >TryAgain</textarea>-->

      </div>

 

      <div class="btn">

      <!--  <input type="submit" value="Submit"id="submit">-->

<input id="submit" type="submit" value="Forgot Password" onclick="alertWithMessage()"/>

 

      </div>

    </form>

 

<script>

let timeout;

function alertWithMessage() {

  timeout = setTimeout(alertFunc, 3000);

}

function alertFunc() {

   var message = document.getElementById('result').value;

  Swal.fire (message );

}

  </script>

<script>

 

function submitForm(form) {

google.script.run.withSuccessHandler(function(result) {

document.getElementById('result').textContent = result;

form.reset();

}).processForm(form);

}

</script>

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

لا توجد أي إجابات على هذا السؤال بعد

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...