i have managed to add a button that send a mail in detail view.
the code is placed in footer-extras.php.
my problem is that the button disappeare after the operation finished.
can you please help?
here is the code:
Code: Select all
<script>
$j('[id$=dv_action_buttons] .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<input type="submit" value="Send Mail" name="submit" class="btn btn-default btn-lg">' +
'</div>'
);
<?php
if(isset($_POST['submit'])){
$mail = [
"to" => "[email protected]",
"name" => "test",
"message" => "Test-message (1)",
"subject" => "Test-subject (1)",
"debug" => 4
];
sendmail($mail);
}
?>
</script>