Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In the situations described below, you can override the default emails that are sent out by Plate, by creating a theme file in the mails folder.

Authentication

Custom Email Subject

It is possible to create a custom subject through a separate theme file. The theme file needs to be named after the specific email type. Create the theme file in:

mails/authentication/In the email you can use the following variables:

  • site as in the object: site

  • site_translations To use a site object in a different language. For example site_translations.en for the English site object.

  • [authentication_type_

...

  • name]

...

  • , e.g. user

See the variables used per specific email_type as described below.

Authentication

confirm_email

For authentication confirmation emails, create a theme file in mails/authentication/[authentication_type_plural_name]/confirm.plate.

In the email you can use the following variables:

...

site.name

...

site.domain

...

additional variable:

  • confirmation_url

  • [authentication_type_name], e.g. user

Example:

Code Block
Hi {{ user.name }},

Welcome to {{ site.name }} ({{ site.domain }}). 
Your email is {{ user.email }}.
Please confirm: {{ confirmation_url }}.
Info

You can setup the redirect after user confirm their email address as: redirect_to_url param. E.g

{{ confirmation_url }}&redirect_to_url=http://www.rubyonrails.org

Custom Email Subject

It is possible to create a custom subject through a separate theme file. The theme file needs to be named after the specific email type. Create the theme file in:

mails/authentication/[authentication_type_plural_name]/confirm_subject.plate

Using this custom subject will override the default subject for confirm email type.

reconfirm_email

For authentication reconfirmation emails, create a theme file in mails/authentication/[authentication_type_plural_name]/reconfirm.plate. This email is sent when an email address is changed.

In the email you can use the following variables:

...

site.name

...

site.domain

...

additional variable:

  • confirmation_url

  • [authentication_type_name], e.g. user

Example:

Code Block
Hi {{ user.name }},

Your email was changed to {{ user.email}}, on {{ site.name }} ({{ site.domain }}). 
Please confirm: {{ confirmation_url }}
Custom Email Subject

It is possible to create a custom subject through a separate theme file. The theme file needs to be named after the specific email type. Create the theme file in:

mails/authentication/[authentication_type_plural_name]/reconfirm_subject.plate

Using this custom subject will override the default subject for reconfirm email type.

password_reset_email

For authentication reconfirmation emails, create a theme file in mails/authentication/[authentication_type_plural_name]/reset_password.plate. This email is sent when a password reset was requested.

In the email you can use the following variables:

...

site.name

...

site.domain

...

site_translations

additional variable:

  • reset_url

  • [authentication_type_name], e.g. user

Example:

Code Block
Hi {{ user.name }},

A change in your password was requested on {{ site.name }} ({{ site.domain }}). 
Change password: {{ reset_url }}
Custom Email Subject

It is possible to create a custom subject through a separate theme file. The theme file needs to be named after the specific email type. Create the theme file in:

mails/authentication/[authentication_type_plural_name]/reset_password_subject.plate

Using this custom subject will override the default subject for reset email type.

invite_email

For authentication reconfirmation emails, create a theme file in mails/authentication/[authentication_type_plural_name]/invite.plate. This email is sent when somebody is invited to register.

In the email you can use the following variablesadditional variable:

  • site.name

  • site.domain

  • site_translations

  • invite_url[authentication_type_name], e.g. user

Example:

Code Block
Hi {{ user.name }},

You were invited as a user to {{ site.name }} ({{ site.domain }}). 
Accept invitation: {{ invite_url }}
Custom Email Subject

It is possible to create a custom subject through a separate theme file. The theme file needs to be named after the specific email type. Create the theme file in:

mails/authentication/[authentication_type_plural_name]/invite_subject.plate

Using this custom subject will override the default subject for inviteemail type.