A question about the use of Sweetalert2.
I have a custom button to send an email with a selection of records.
I want a sweet alert before the email is sent, so where is there a comment before sending.
Where should I place that sweet alert?
In the event Client before, Server, Client after? Or in another place?
can anyone help me?
Thanks,
this is on the server tab :
while( $data = $button->getNextSelectedRecord() )
{
$newdate = date("d/m/Y", strtotime($data['datum']));
$email="test@digiskills.be";
{
$body = "Datum : " . $newdate . " van " . $data['uur1'] . " tot " . $data['uur2'] . " uur" . "\r\n";
$body .= "Opleiding: " . $data['opleiding'] . "\r\n";
$body .= " "."\r\n";
$body .= "NOG INSTRUCTEURS NODIG ? " . $data['nodig'] . "\r\n";
$body .= "Reeds voorziene instructeurs: " . $data['instructeur'] ."\r\n";
$body .= " "."\r\n";
$body .= "Opmerking: " . $data['opmerkingen'] . "\n---------------------------------\n\n";
}
$body .= "Beste instructeurs,"."\r\n";
$body .= "Er werd een nieuwe opleiding ingebracht in de planning."."\r\n";
$body .= "Indien INSTRUCTEURS NODIG = JA kan je je beschikbaar zetten, ga dan naar de DB SharePoint - rubriek TERBESCHIKKING INSTR. "."\r\n";
$body .= "Indien er in dit bericht staat INSTRUCTEURS NODIG : NEE dan verschijnen deze NIET in de module TERBESCHIKKING. "."\r\n";
$body .= " "."\r\n";
$body .= "Met vriendelijke groeten,"."\r\n";
$body .= " Dirk De Clercq"."\r\n";
// send the email
$subject = "Nieuwe opleiding beschikbaar";
$arr = runner_mail(array('to' => $email, 'subject' => $subject,'body' => $body));
}
$result["txt"] = "Emails zijn verzonden.";
// if error happened print a message on the web page
if( !$arr["mailed"] )
{
$errmsg = "Fout: geen data geselecteerd";
$result["txt"] = $errmsg;
}