11 New User Notifications
Select a tab above to activate This blank page message helps protect your privacy, or you can show the first message here automatically through settings page
- Melissa Ayre INBOX Re: New security codes Hello again and thanks for being part... 56 seconds ago
- Adison Lee Msed quia non numquam eius 2 minutes ago
- Oliver Kopyuv Msed quia non numquam eius 3 days ago
- Dr. John Cook PhD Msed quia non numquam eius 2 weeks ago
- Sarah McBrook Msed quia non numquam eius 3 weeks ago
- Anothony Bezyeth Msed quia non numquam eius one month ago
- Lisa Hatchensen Msed quia non numquam eius one year ago
-
Administrator UPDATE System updated to version 4.6.3 (patch notes) 5 mins ago
-
Adison Lee replied to your video Cancer Drug Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day... 10 minutes ago
[your date here]
|
||||||
---|---|---|---|---|---|---|
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 1 | 2 | 3 |
2:30PM - Doctor's appointment
3:30PM - Report overview
4:30PM - Meeting with Donnah V.
5:30PM - Late Lunch
6:30PM - Report Compression
- SmartAdmin
- Mailer
- Documentation
Documentation
SmartAdmin's built-in Mailing functionalities. Learn more how \Common\Mailer
works.
Documentation
PHP Mailer
SmartAdmin PHP's native email library that supports out-of-the-box templates. You will be using the \Common\Mailer
library.
Usage
$mailer = new \Common\Mailer();
$subject = 'Hello there';
$body = 'Hellow world';
$mailer->submit('to@recipient.com', $subject, $body);
Config
The email credentials are configured in the .env
file. Learn about securing credentials here.
This supports various outgoing method such as smtp, sendmail and mail.
APP_EMAIL_MAILER=smtp
APP_EMAIL_HOST=YOUR_HOST
APP_EMAIL_PORT=YOUR_PORT
APP_EMAIL_USER=YOOUR_USERNAME
APP_EMAIL_PASSWORD=****
APP_EMAIL_SECURE=ssl
APP_EMAIL=my@email.com
Templates
Templates that are availble for you to use. They are located in /public/assets/email
folder. You can view how each built-in template looks like here.
default.html
- Template used for default notification email2fa.html
- Template used for Two-Factor-Authentication (2FA)verify.html
- Template used for Account verification
These templates are defined in the class as follows:
const TEMPLATE_DEFAULT = 'default';
const TEMPLATE_VERIFY_EMAIL = 'verify';
const TEMPLATE_2FA_CODE = '2fa';
Format Body
To use a template, you need to call \Common\Mailer::formatBody(..., $template)
method to geneate the content. It should look something like this:
$subject = 'Hello world';
$body = \Common\Mailer::formatBody('Hello there', \Common\Mailer::TEMPLATE_DEFAULT);
$mailer = new \Common\Mailer;
$mailer->submit('to@recipient.com', $subject, $body);
Attachments
Mailer
also supports attachments. You can pass in single or multiple files during submission.
To send multiple attachments, just pass in an array
of files. keys
acts as the filename (optional).
$file_path = '/path/to/my/report.csv';
$mailer->submit('to@recipient.com', $subject, $body, $file_path);
Credits
SmartAdmin uses PHPMailer/PHPMailer package to handle the mailing functionality.