Emails in Osclass, the ultimate guide

Documentation, Osclass

Now that EmailMagick, our new plugin for Osclass is out on the market to help you deal with emails in Osclass, what you needed was the ultimate guide to Osclass emails, a complete documentation describing what they do, what are the available words and filters.

This document has been written for Osclass v3.5, so it shouldn’t be that far  from what you have on your Osclass website but it might be a little different.

  1. Manage emails in Osclass
  2. List of Osclass emails
  3. Difference between *_LINK and *_URL
    1. Basic example
    2. Real life example with Madhouse Messenger
  4. Using filters in emails

1- Manage emails in Osclass

To manage emails, head to the Osclass administration under Settings > Email templates. You will then be able to view the list of all your emails, preview them and edit them.

Osclass Emails - Link to email templates in administration menu

Here’s what it looks like, editing manually an email template:

Osclass Emails - Edit an email template in administration page

If you’re not comfortable editing the code using the wysiwyg editor, you still can open Tools > Source code and edit the raw HTML code, like in the screenshot above.

2- List of Osclass emails

Out of the box, Osclass ships many emails to support its many features and settings. Here’s the complete list, with description and available keywords and filters for each of them.

email_alert_validation

Sent to a (non-registered) user when he subscribe to an alert (in the search) to validate his subscription to it.

'{USER_NAME}',
'{USER_EMAIL}',
'{VALIDATION_LINK}'

Filters: email_alert_validation_title_after, email_alert_validation_description_after

alert_email_hourly

Alert sent hourly (using cron), to notify subscribers of new ads in the last hour.

'{USER_NAME}',
'{USER_EMAIL}',
'{ADS}',
'{UNSUB_LINK}'

Filters:

  • alert_email_hourly_title
  • alert_email_hourly_description
  • alert_email_hourly_title_after
  • alert_email_hourly_description_after
alert_email_daily

Alert sent daily (using cron) to notify subscribers of new ads since yesterday.

'{USER_NAME}',
'{USER_EMAIL}',
'{ADS}',
'{UNSUB_LINK}'

Filters:

  • alert_email_daily_title
  • alert_email_daily_description
  • alert_email_daily_title_after
  • alert_email_daily_description_after
alert_email_weekly

Alert sent weekly (using cron) to notify subscribers of new ads since last week.

'{USER_NAME}',
'{USER_EMAIL}',
'{ADS}',
'{UNSUB_LINK}'

Filters:

  • alert_email_weekly_title
  • alert_email_weekly_description
  • alert_email_weekly_title_after
  • alert_email_weekly_description_after
alert_email_instant

Alert sent instantly to subscribers when a new ads (corresponding to an alert) is posted on the website.

'{USER_NAME}',
'{USER_EMAIL}',
'{ADS}',
'{UNSUB_LINK}'

Filters:

  • alert_email_instant_title
  • alert_email_instant_description
  • alert_email_instant_title_after
  • alert_email_instant_description_after
email_comment_validated

Sent to a comment author when its comment has been validated by an administrator.

'{COMMENT_AUTHOR}',
'{COMMENT_EMAIL}',
'{COMMENT_TITLE}',
'{COMMENT_BODY}',
'{ITEM_URL}',
'{ITEM_LINK}',
'{ITEM_TITLE}'

Filters:

  • email_comment_validated_title
  • email_comment_validated_description
  • email_comment_validated_title_after
  • email_comment_validated_description_after
email_new_item_non_register_user

Sent to a non-registered user when he successfully posted an item.

'{ITEM_ID}',
'{USER_NAME}',
'{USER_EMAIL}',
'{ITEM_TITLE}',
'{ITEM_URL}',
'{ITEM_LINK}',
'{EDIT_LINK}',
'{EDIT_URL}',
'{DELETE_LINK}',
'{DELETE_URL}'

Filters: 

  • email_new_item_non_register_user_title
  • email_new_item_non_register_user_description
  • email_new_item_non_register_user_title_after
  • email_new_item_non_register_user_description_after
email_user_forgot_password

Sent when a user asks for a new password (has forgot his password).

'{USER_NAME}',
'{USER_EMAIL}',
'{PASSWORD_LINK}',
'{PASSWORD_URL}',
'{DATE_TIME}'

Filters:

  • email_user_forgot_pass_word_title
  • email_user_forgot_password_description
  • email_user_forgot_pass_word_title_after
  • email_user_forgot_password_description_after
email_user_registration

Sent a user has succesfully registered on the website.

'{USER_NAME}',
'{USER_EMAIL}'

Filters:

  • email_user_registration_title
  • email_user_registration_description
  • email_user_registration_title_after
  • email_user_registration_description_after
email_new_email

Sent to a user he modifies his email address, asking him to validate it.

 '{USER_NAME}',
 '{USER_EMAIL}',
 '{VALIDATION_LINK}',
 '{VALIDATION_URL}'

Filters:

  • email_new_email_title
  • email_new_email_description
  • email_new_email_title_after
  • email_new_email_description_after
email_user_validation

Sent to a user when he submit the registration form (asking him to validate his e-mail address).

'{USER_NAME}',
'{USER_EMAIL}',
'{VALIDATION_LINK}',
'{VALIDATION_URL}'

Filters:

  • email_user_validation_title
  • email_user_validation_description
  • email_user_validation_title_after
  • email_user_validation_description_after
email_send_friend

Email sent when someone shares an item via email to a friend.

 '{FRIEND_NAME}',
 '{USER_NAME}',
 '{USER_EMAIL}',
 '{FRIEND_EMAIL}',
 '{ITEM_TITLE}',
 '{COMMENT}',
 '{ITEM_URL}',
 '{ITEM_LINK}'

Filters:

  • email_send_friend_title
  • email_send_friend_description
  • email_send_friend_title_after
  • email_send_friend_description_after
email_item_inquiry

Sent when someone contacts an item (sent to the item owner).

 '{CONTACT_NAME}',
 '{USER_NAME}',
 '{USER_EMAIL}',
 '{USER_PHONE}',
 '{ITEM_TITLE}',
 '{ITEM_URL}',
 '{ITEM_LINK}',
 '{COMMENT}'

Filters:

  • email_item_inquiry_title
  • email_item_inquiry_description
  • email_item_inquiry_title_after
  • email_item_inquiry_description_after
email_new_comment_admin

Email received by an admin when a new comment is posted on the website.

 '{COMMENT_AUTHOR}',
 '{COMMENT_EMAIL}',
 '{COMMENT_TITLE}',
 '{COMMENT_TEXT}',
 '{ITEM_TITLE}',
 '{ITEM_ID}',
 '{ITEM_URL}',
 '{ITEM_LINK}'

Filters:

  • email_new_comment_admin_title
  • email_new_comment_admin_description
  • email_new_comment_admin_title_after
  • email_new_comment_admin_description_after
email_item_validation

Email received by a user when he posted an item and he needs to validate it.

 '{ITEM_DESCRIPTION_ALL_LANGUAGES}',
 '{ITEM_DESCRIPTION}',
 '{ITEM_COUNTRY}',
 '{ITEM_PRICE}',
 '{ITEM_REGION}',
 '{ITEM_CITY}',
 '{ITEM_ID}',
 '{USER_NAME}',
 '{USER_EMAIL}',
 '{ITEM_TITLE}',
 '{ITEM_URL}',
 '{VALIDATION_LINK}',
 '{VALIDATION_URL}'

Filters:

  • email_item_validation_title
  • email_item_validation_description
  • email_item_validation_title_after
  • email_item_validation_description_after
email_admin_new_item

Email received by the admin when a new item is posted on the website.

 '{EDIT_LINK}',
 '{EDIT_URL}',
 '{ITEM_DESCRIPTION_ALL_LANGUAGES}',
 '{ITEM_DESCRIPTION}',
 '{ITEM_COUNTRY}',
 '{ITEM_PRICE}',
 '{ITEM_REGION}',
 '{ITEM_CITY}',
 '{ITEM_ID}',
 '{USER_NAME}',
 '{USER_EMAIL}',
 '{ITEM_TITLE}',
 '{ITEM_URL}',
 '{VALIDATION_LINK}',
 '{VALIDATION_URL}'

Filters:

  • email_admin_new_item_title
  • email_admin_new_item_description
  • email_admin_new_item_title_after
  • email_admin_new_item_description_after
email_item_validation_non_register_user

Same as the email_item_validation, but for a non-registered user.

 '{ITEM_DESCRIPTION_ALL_LANGUAGES}',
 '{ITEM_DESCRIPTION}',
 '{ITEM_COUNTRY}',
 '{ITEM_PRICE}',
 '{ITEM_REGION}',
 '{ITEM_CITY}',
 '{ITEM_ID}',
 '{USER_NAME}',
 '{USER_EMAIL}',
 '{ITEM_TITLE}',
 '{ITEM_URL}',
 '{VALIDATION_LINK}',
 '{VALIDATION_URL}',
 '{EDIT_LINK}',
 '{EDIT_URL}',
 '{DELETE_LINK}',
 '{DELETE_URL}'

Filters:

  • email_item_validation_non_register_user_title_after
  • email_item_validation_non_register_user_description_after
email_admin_new_user

Notification for the admin when a new user registers on the website.

 '{USER_NAME}',
 '{USER_EMAIL}'

Filters:

  • email_admin_user_registration_title
  • email_admin_user_regsitration_description
  • email_admin_user_registration_title_after
  • email_admin_user_regsitration_description_after
email_contact_user

Email received by a user when someone contacts him via his profile.

 '{CONTACT_NAME}',
 '{USER_NAME}',
 '{USER_EMAIL}',
 '{USER_PHONE}',
 '{COMMENT}'

Filters:

  • email_item_inquiry_title
  • email_item_inquiry_description
  • email_item_inquiry_title_after
  • email_item_inquiry_description_after
email_new_comment_user

Email sent to an item owner when someone leave a comment on his item.

 '{COMMENT_AUTHOR}',
 '{COMMENT_EMAIL}',
 '{COMMENT_TITLE}',
 '{COMMENT_TEXT}',
 '{ITEM_TITLE}',
 '{ITEM_ID}',
 '{ITEM_URL}',
 '{ITEM_LINK}',
 '{SELLER_NAME}',
 '{SELLER_EMAIL}'

Filters:

  • email_new_comment_user_title
  • email_new_comment_user_description
  • email_new_comment_user_title_after
  • email_new_comment_user_description_after
email_new_admin

Email notification when a new administrator is added.

 '{ADMIN_NAME}',
 '{USERNAME}',
 '{PASSWORD}',
 '{WEB_ADMIN_LINK}'

Filters:

  • email_new_admin_title
  • email_new_admin_description
  • email_new_admin_title_after
  • email_new_admin_description_after
email_warn_expiration

Warns a user that his item will expire in X days.

 '{USER_NAME}',
 '{ITEM_TITLE}',
 '{ITEM_ID}',
 '{ITEM_EXPIRATION_DATE}',
 '{ITEM_URL}',
 '{ITEM_LINK}',
 '{SELLER_NAME}',
 '{SELLER_EMAIL}',
 '{CONTACT_NAME}',
 '{CONTACT_EMAIL}'

Filters:

  • email_warn_expiration_title
  • email_warn_expiration_description
  • email_warn_expiration_title_after
  • email_warn_expiration_description_after

You’ll often see two types of words in emails, *_LINK and *_URL. For example, ITEM_LINK and ITEM_URL. *_LINK words contain a complete pre-formatted HTML link while *_URL only the raw url (an HTTP string).

3.1- Basic example

For example, the WEB_LINK word will translate to:

<a href="http://yourwebsite.com/">Your Website Name</a>

3.2- Real life example with Madhouse Messenger

Madhouse Messenger provides a list of words such as THREAD_URL, complete list is given on the documentation page.

If you want to make a clickable link to the conversation, you would insert a link and type {THREAD_URL} as the url and your link text.

Osclass Emails - Add a clickable link to email templates using word replacements

You would write in raw HTML mode:

<a href="{THREAD_URL}">See conversation</a>

Using filters in emails

Filters in emails allows you to customize emails in Osclass. If you want to add a new word to an email (or many emails), filters are the way to go. All emails have filters, both before words are replaced and after. They also all share two filters email_title and email_description.

Here’s a quick example on how to add a word in every emails. With this snippet in your functions.php of your current theme, whenever an email contains the keyword {MADHOUSE}, it will get replaced by Madhouse is awesome!

<?php 

osc_add_filter("email_description", function($string) {
	return osc_mailBeauty(
		$string,
		array('{MADHOUSE}'),
		array(__('Madhouse is awesome!'))
	);
});

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s