Email templates improvements

Osclass have email templates for multiple purposes such as verify user account, notify new items, etc.

You can customize your email templates like you want, going to

‘Admin panel -> Settings -> Email templates’

As you can see, email templates can have email variables  like {EMAIL_VAR}  in Title and Description (  title as email subject and description as email body ).

For example you can have a email template with a subject like this:

    ‘Hi {USER_NAME} welcome to {WEB_TITLE}’

There are two email variables, which will be replaced before email is sent.

    {WEB_TITLE}  , will be replaced by web title.

    {USER_NAME}, will be replaced by user name.

We will receive an email with subject like:

    ‘Hi Carlos, welcome to osclass.org’

Recently added :

  •  Test it button, that allows you given an email to send a template preview of the actual template.
  •  A legend with short descriptions of email variables to make email templates more understandable.

Example of Use

Plugin name: send_email_example

Description: This is an example that create his own email template and send emails with custom email variables.

This plugin sends an email saying thanks and showing the number of items belonging to a user, when a listing is added by user and only if user have more than one item published.

This plugin use EmailVariables class, that is used when edit email templates for show the legend, in this case add {NUMBER_LISTINGS} variable and set a description.

EmailVariables::newInstance()->add(‘{NUMBER_LISTINGS}’, __(‘Number of listing that belong to user.’, ‘send_email_example’));

Here you can download a plugin example. ( Plugin is well documented If you have any doubt don’t hesitate to ask )

NOTE: This features are only available if you use a develop branch of Osclass. Will be added on Osclass 3.1.0.