This function allows you to send emails using SMTP and beautifully designed email templates.
To get started you need to ensure that you have setup the email variables on your .env
file. Also you have a logo on your /uploads/app/
folder that will also the set on the .env file as APP_LOGO
variable.
Check out more on env here;
Parameters
Parameter
Required
Type
Description
$to
Yes
string
Email of the recipient.
$subject
Yes
string
Subject of the email
$view_data
Yes
array
Array of data to print on the template. The structure of each template is explained below.
$view_name
No
string
The name of the template file in the /views/email/html folder without extension. e.g basic | withbutton | invoice
$from
No
string
Where the email is from e.g Simcy Creative <hello@simcycreative.com>
$attachements
No
array
array with full paths files to attach.
Usage
Basic template
screenshot
Sample array
All array values are required.
Variable
Type
Description
message
string
The message to send on email.
Template with button
screenshot
Sample array
All array values are required.
Variable
Type
Description
title
string
The title of the email
subtitle
string
The email subtitle
buttonText
string
The label of the button
buttonLink
string
The link of the button
message
string
The message to send on email.
Invoice Template
screenshot
Sample array
All array values are required.
Variable
Type
Description
title
string
The title of the email
subtitle
string
The email subtitle
summary
array
This is an array containing: currency, subtotal, total & tax
items
array
This is an array of items with array of item details. Each array will have name, quantity & price
Last updated