Vendors
Sometimes you need to use external libraries because it's much faster than writing the code yourself. Sometimes you don't really have a choice, for instance implementing a payment system like Stripe. You can use composer or do it manually to add these libraries. Just make sure you put them all in the Vendor directory.
Examples
We loaded one vendor library in SlenderApi to use as an example, and so you can send emails by default, PHPMailer.
//We used the MailHelper to wrap PHPMailer. //It is recommended to wrap all vendor libraries with your own helper classes. //In the mail helper, we include the php mailer. use PHPMailer\PHPMailer\PHPMailer; //In your library, you can include the mail helper and email template helper. use SlenderApi\Helpers\EmailTemplatesHelper; use SlenderApi\Helpers\MailHelper; $mailHelper = new MailHelper(); $templateHelper = new EmailTemplatesHelper(); //Pass values to your template. $template = $templateHelper->loadForgotPasswordTemplate($tokenValue, $user->user_name); //Send your email and log it using the Email Log Model. $mailHelper->sendMail($emailAddress, $template['subject'], $template['message'], new Models\EmailLogModel($this->db, 0));