| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <?php
- namespace App\Common\Email;
- use \App\Core\Template\Output as Output;
- use \App\Core\Email\Classes\Email as Email;
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\SMTP;
- use PHPMailer\PHPMailer\Exception;
- class EmailController extends \DefaultController
- {
- protected $_class = Email::class;
- protected $_baseUrl = '/email';
- /**
- * Index
- * Show the main Email list
- */
- function index()
- {
- Output::render('index');
- /*
- $mail = new PHPMailer(true);
- // Server settings
- $mail->SMTPDebug = SMTP::DEBUG_SERVER; // for detailed debug output
- $mail->isSMTP();
- $mail->Host = 'smtp.gmail.com';
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
- $mail->Port = 587;
- $mail->Username = 'ahwelp@universo.univates.br';
- $mail->Password = '********';
- // Sender and recipient settings
- $mail->setFrom('ahwelp@universo.univates.br', 'Sender Name');
- $mail->addAddress('ahwelp@univates.br', 'Receiver Name');
- $mail->addReplyTo('ahwelp@universo.univates.br', 'Sender Name');
- // Setting the email content
- $mail->IsHTML(true);
- $mail->Subject = "Send email using Gmail SMTP and PHPMailer";
- $mail->Body = 'HTML message body. <b>Gmail</b> SMTP email body.';
- $mail->AltBody = 'Plain text message body for non-HTML email client. Gmail SMTP email body.';
- $mail->send();
- echo "Email message sent.";*/
- }
- /**
- * Create
- *
- * Render the main Email formulary
- */
- function create()
- {
- Output::render('form', ['id' => 0]);
- }
- /**
- * Store
- *
- * Store the param on the database
- * @param Email $email
- */
- function store(Email $email)
- {
- }
- /**
- * Search
- *
- * Store the param on the database
- * @param Email $email
- */
- function search()
- {
- }
- /**
- * Show
- *
- * Render one register
- *
- * @param Email $email
- */
- function show(Email $email)
- {
- }
- /**
- * Edit
- *
- * Render the formular for a database Email
- *
- * @param Email $email
- */
- function edit(Email $email)
- {
- Output::render('form', $email);
- }
- /**
- * Update
- * Store the changes of the param on the database
- *
- * @param Email $email
- */
- function update(Email $email)
- {
- }
- /**
- * Destroy
- * If the object has soft delete.
- *
- * @param Email $email
- */
- function destroy(Email $email)
- {
- }
- /**
- * Purge
- * Remove object even with soft delete.
- *
- * @param Email $email
- */
- function purge(Email $email)
- {
- }
- }
|