I need to send an email using PHP, which could be easily done using SMTP, but the challenge is to embed a web service in the HTML mail, which is why I used JavaScript in the body of the message to access the Web service when a button click is triggered.
Asked
Active
Viewed 503 times
-3
-
you can use AJAX to call... – Sayed Mohd Ali Feb 18 '19 at 08:57
-
do not have form to send by Ajax but it's HTML5 plagin dom jquery example10$("#menu_plus1").click(function(){ $calcule = 9.9 * 5; $("#result1").html($calcule); $totale = $("#result1").html($calcule); }); – Mohamed Cherif Fares Feb 18 '19 at 09:03
-
share your code – Sayed Mohd Ali Feb 18 '19 at 09:04
-
It is a bad practice to add Javascript in email templates. [here](https://stackoverflow.com/questions/1088016/html-email-with-javascript) – Ekown Feb 18 '19 at 09:33
-
how can i make the project function when computed and given in jquery? – Mohamed Cherif Fares Feb 18 '19 at 09:38
-
Forget about using JavaScript _in_ emails … https://stackoverflow.com/questions/1088016/html-email-with-javascript – 04FS Feb 18 '19 at 09:44
1 Answers
0
<div class="container">
<div class="row">
<div class="col-lg-5 " >
<div class="shadow bg-white stick-to-content mb-4">
<div class="bg-dark dark p-4"><h5 class="mb-0">Votre commande</h5></div>
<div id="mainDiv">
<div class="bg-dark dark p-4 hide"><h5 class="mb-0">Son commande</h5></div>
<table class="table-cart" id="table-cart">
<!-- Contenu du cart list (liste de meal) -->
<!-- content code jquery -->
</table>
<div class="cart-summary">
<div class="row">
<div class="col-7 text-right text-muted">Order total:</div>
<div class="col-5"><strong class="orderTotal"></strong></div>
</div>
<div class="row devlieryHide">
<div class="col-7 text-right text-muted">Devliery:</div>
<div class="col-5"><strong class="devliery"></strong></div>
</div>
<hr class="hr-sm">
<div class="row text-lg">
<div class="col-7 text-right text-muted">Total:</div>
<div class="col-5"><strong class="total"></strong></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-7 ">
<form action="{{route('sendCHeckOutToMail')}}" method="post">
@csrf
<div class="bg-white p-4 p-md-5 mb-4">
<h4 class="border-bottom pb-4"><i class="ti ti-user mr-3 text-primary"></i>Informations de base</h4>
<div class="row mb-5">
<div class="form-group col-sm-6">
<label>Nom:</label>
<input type="text" name="nom" class="form-control">
</div>
<div class="form-group col-sm-6">
<label>Prénom:</label>
<input type="text" name="prenom" class="form-control">
</div>
<div class="form-group col-sm-6">
<label>Ville:</label>
<input type="text" name="ville" class="form-control">
</div>
<div class="form-group col-sm-6">
<label>Rue et numéro:</label>
<input type="text" name="zip_code" class="form-control">
</div>
<div class="form-group col-sm-6">
<label>Téléphone:</label>
<input type="text" name="phone" class="form-control">
</div>
<div class="form-group col-sm-6">
<label>E-mail:</label>
<input type="email" name="mail" class="form-control">
</div>
</div>
<h4 class="border-bottom pb-4"><i class="ti ti-package mr-3 text-primary"></i>Livraison</h4>
<div class="row mb-5">
<div class="form-group col-sm-6">
<label>Heure de livraison:</label>
<div class="select-container">
<select name="date_livraison" class="form-control">
<option>Aussi vite comme possible</option>
<option>Dans une heure</option>
<option>Dans deux heures</option>
</select>
</div>
</div>
</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-primary btn-lg"><span>Commandez maintenant!</span></button>
</div>
</form>
</div>
</div>
</div>
</section>
<!-- Fonctions du cart Shopping -->
<script src="{{ asset('frontEnd/assets/js/js/cartShopping.js') }}"></script>
<!-- Evenements du carnet d'adresses -->
<script src="{{ asset('frontEnd/assets/js/js/events.js') }}"></script>