@sineld hocam cevap için teşekkürler.
her mail formu geldiğinde. 3 adet mail gönderiyorum sendgrid üzerinden. asıl sorun kişi forma tıklayınca işlemi bir kaç saniyede yapıyor ve kişi olmadı diye bir kaç defa tıklıyor ve birden fazla işlem gerçekleşiyor.
foreach ($us as $ab)
{
$dene=$ab->email;
$adi=$ab->name;
$data = ['ad' => $input['ad'], 'eposta' => $input['eposta'],'telefon' => $input['telefon'],'tarih' => $input['tarih'],'t' => $dene,'idi' => $input['id'],'adi' => $adi];
Mail::send('emails.gunaydin', $data, function($message) use($data)
{
$message->to("$data[t]", $data['ad'])
->subject('Randevu Talebi - ep.com')
->replyTo("info@ep.com", 'noReplay');
});
$data = ['ad' => $input['ad'], 'eposta' => $input['eposta'],'telefon' => $input['telefon'],'tarih' => $input['tarih'],'idi' => $input['id'],'adi' => $adi];
Mail::send('emails.gunaydin', $data, function($message) use($data)
{
$message->to("abc@gmail.com", $data['ad'])
->subject('Randevu Talebi - ep.com')
->replyTo("info@ep.com", 'noReplay');
});
if (!empty($input['eposta'])) {
$data = ['ad' => $input['ad'], 'eposta' => $input['eposta'],'telefon' => $input['telefon'],'tarih' => $input['tarih'],'idi' => $input['id'],'adi' => $adi];
Mail::send('emails.danisan', $data, function($message) use($data)
{
$e=$data['eposta'];
$message->to("$e", $data['ad'])
->subject('Randevu Talebi - ep.com')
->replyTo("info@ep.com", 'noReplay');
});
}