simple moodle plugin development html form

simple moodle plugin development html form

by Majid Noori -
Number of replies: 3

 

i am new to Moodle however i can do what i want in Php language. i need to add some functionality to Moodle admin dashboard ,it is like sending email to email address that would be filled(text field) by Moodle admin, now i wonder which type of Moodle plugin should i develope: block,admin tools or .. ?

<form action="/action_page.php" method="post">
  email address:<br>
  <input type="text" name="e_address" value="">
  <br>
  message body:<br>
  <input type="text" name="e_body" value="">
  <br><br>
  <input type="submit" value="Submit">
</form> 

then in php file(action_page.php) the process is like this:

<?php

$email_address=$_POST['e_address'];

$message=$_POST['e_body'];

// From
$header="from: admin name <admin@dfsgr.kjk>";
$subject="subjet";

$send_contact=mail($email_address,$subject,$message,$header);


if($send_contact){
echo "Email sent successfully";
}
else {
echo "ERROR";
}
?>

to be exact my question is more about plugin types and which that fits my needs and all i need is something like below image prototype


Average of ratings: -
In reply to Majid Noori

Re: simple moodle plugin development html form

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Take a look at some of the blocks that already exist with full email functionality, and then simplify them if needed - eg

https://moodle.org/plugins/block_admin_email

https://moodle.org/plugins/block_quickmail

https://moodle.org/plugins/block_jmail

(I use Quickmail)

Average of ratings: Useful (1)
In reply to Richard Oelmann

Re: simple moodle plugin development html form

by Majid Noori -

looking at quickmail helped. thnaks