email_templates.php

File structure

This file contains email template keywords for your plugin. It does not contain email subject or message (those are stored in language files).

$templates = array(
	'users_account_confirm',
	'users_signup_new'
);

Email templates are saved into the "core_email_templates" table in the database.

Sending email templates

You may access email templates and send them like this:

loader::library('email');
$this->email->sendTemplate('users_account_confirm', 'john@email.com');
$this->email->sendTemplate('users_signup_new', 'john@email.com');

Language file

Language file "languages/english.php" will contain code like this:

$email_templates = array(
	'users_account_confirm' => array( // email template keyword
		// name of the email template
		'name' => "Email address verification",
		// subject
		'subject' => "Confirm your email address",
		// HTML message
		'message_html' => "<p><a href=\"[activation_link]\">Confirm your email</a> to be able to access the site and enjoy all of its benefits.</p>",
		// plain text message
		'message_text' => "Confirm your email to be able to access the site and enjoy all of its benefits.\n\nFollow the link below to confirm it:\n[activation_link]"
	),
	'users_signup_new' => array(
		'name' => "New user notification",
		'subject' => "New user has just signed up",
		'message_html' => "<p><a href=\"[profile_link]\">New user</a> has just signed up.</p>",
		'message_text' => "New user has just signed up.\n\nFollow the link below to see their account:\n[profile_link]"
	)
);