Skip to content

Commit c1500b9

Browse files
committed
Update README.md
1 parent da1af4a commit c1500b9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ Currently, `activity_notification` is only supported with ActiveRecord ORM in Ra
2424
1. [Preparing target notifications](#preparing-target-notifications)
2525
2. [Rendering notifications](#rendering-notifications)
2626
3. [Notification views](#notification-views)
27-
4. [i18n](#i18n)
27+
4. [i18n for notifications](#i18n-for-notifications)
2828
5. [Grouping notifications](#grouping-notifications)
29-
9. [Configuring email notifications](#configuring-email-notifications)
29+
9. [Configuring email notification](#configuring-email-notification)
30+
1. [Setup mailer](#setup-mailer)
31+
2. [Email templates](#email-templates)
32+
3. [i18n for email](#i18n-for-email)
3033
4. [Testing](#testing)
3134
5. [Documentation](#documentation)
3235
6. **[Common examples](#common-examples)**
@@ -338,7 +341,7 @@ If a view file does not exist then ActionView::MisingTemplate will be raised. If
338341
<%= render_notification(@notification, fallback: :text) %>
339342
```
340343

341-
#### i18n
344+
#### i18n for notifications
342345

343346
Translations are used by the `#text` method, to which you can pass additional options in form of a hash. `#render` method uses translations when view templates have not been provided. You can render pure i18n strings by passing `{i18n: true}` to `#render_notification` or `#render`.
344347

@@ -396,13 +399,13 @@ First, you need to set up the default URL options for the `activity_notification
396399
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
397400
```
398401

399-
#### Notification email views
402+
#### Email templates
400403

401404
`activity_notification` will look for email template in the same way as notification views. For example, if you have an notification with `:key` set to `"notification.article.comment.replied"` and target_type `users`, the gem will look for a partial in `app/views/activity_notification/mailer/users/article/comment/_replied.html.(|erb|haml|slim|something_else)`.
402405

403406
If this template is missing, the gem will look for a partial in `default` as the target type which means `activity_notification/mailer/default/_default.html.(|erb|haml|slim|something_else)`.
404407

405-
#### i18n
408+
#### i18n for email
406409

407410
The subject of notification email can be put in your locale `.yml` files as `mail_subject` field:
408411

0 commit comments

Comments
 (0)