using UnityEngine; using System.Text; // Bouton SUPPLIERS/"Button Send to supplier" : prepare la demande pour les fournisseurs // coches dans la liste, puis enchaine sur l'ecran THANKSGO. // A poser sur le bouton et brancher sur son OnClick -> SendSupplier.SendEmail(). public class SendSupplier : MonoBehaviour { public void SendEmail() { if (Suppliers.Selected.Count == 0) { _M.PH(20, 0, "898787", 1, 1);// "Choisissez au moins un fournisseur." return; } // Pas de mailto : ce bouton n'ouvre pas le client courriel. Le contenu est journalise // en attendant l'envoi cote serveur. Debug.Log("[SendSupplier] a : " + Suppliers.SelectedEmails + "\n" + Body()); Measure.goTHANKSGO(Client("Name"), ClientEmail(), Suppliers.SelectedNames, "Supplier Send"); } // Coordonnees du client + lien vers le design, comme dans le courriel au cuisiniste. static string Body() { StringBuilder sb = new(); sb.AppendLine((_G.L == 1) ? "Hello, here is a client looking for a kitchen quote." : "Bonjour, voici un client qui cherche une soumission de cuisine."); sb.AppendLine(); sb.AppendLine(TRANS.This("T_Client Info").ToUpperInvariant() + " ;"); sb.AppendLine("- " + TRANS.This("T_Name") + ": " + Client("Name")); sb.AppendLine("- " + TRANS.This("T_Address") + ": " + Client("Address")); sb.AppendLine("- " + TRANS.This("T_Email") + ": " + ClientEmail()); sb.AppendLine("- " + TRANS.This("T_Phone") + ": " + Client("Phone")); sb.AppendLine(); sb.AppendLine(TRANS.This("T_ClickLink").ToUpperInvariant() + " ;"); string Endpath = _G.PATH == "free" ? "free" : "3d/?" + _G.PATH; sb.AppendLine("https://ukitchenit.com/" + Endpath + "?ai_" + ClientEmail()); sb.AppendLine(); // Rappel des destinataires : le client comme le fournisseur voit a qui la demande part. sb.AppendLine(TRANS.This("T_SendToSupplier").ToUpperInvariant() + " ;"); sb.AppendLine(Suppliers.SelectedNames); sb.AppendLine(); return sb.ToString(); } static string Client(string Key) { return _G.ClientInfo != null && _G.ClientInfo.TryGetValue(Key, out string Value) ? Value : ""; } static string ClientEmail() { return Client("Email"); } }