@bigbinary/neeto-message-templates-frontend 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,10 +21,10 @@ the creation of SMS, Email and Whatsapp templates.
21
21
  bundle install
22
22
  ```
23
23
 
24
- 3. Configure the organization model in the host application.
24
+ 3. Configure the owner model in the host application.
25
25
 
26
26
  ```ruby
27
- has_many :message_templates, class_name: "NeetoMessageTemplatesEngine::MessageTemplate", dependent: :destroy
27
+ has_many :message_templates, as: :owner, class_name: "NeetoMessageTemplatesEngine::MessageTemplate", dependent: :destroy
28
28
  ```
29
29
 
30
30
  4. Add this line to your application's `config/routes.rb` file
@@ -55,6 +55,15 @@ the creation of SMS, Email and Whatsapp templates.
55
55
  end
56
56
  ```
57
57
 
58
+ 7. Create an initializer file in the host app under
59
+ `configs/initializers/neeto-message-templates.rb` & provide the name of owner
60
+ model for the message templates. The message_templates `belongs_to` this
61
+ `owner`.
62
+
63
+ ```ruby
64
+ NeetoMessageTemplatesEngine.owner_class = "Organization"
65
+ ```
66
+
58
67
  # Frontend Package Installation
59
68
 
60
69
  Install the latest `neetoMessageTemplates` package using the below command:
@@ -80,6 +89,10 @@ yarn add @bigbinary/neeto-message-templates-frontend
80
89
 
81
90
  - `templateVariables`: (optional) To add dynamic variables to form body field.
82
91
 
92
+ - `ownerId`: (optional) To provide the `id` of the owner if it is not an
93
+ Organization model. If the owner is an Organization, this prop can be left
94
+ unspecified.
95
+
83
96
  ### Usage
84
97
 
85
98
  ```javascript
@@ -141,6 +154,10 @@ const App = () => {
141
154
 
142
155
  - `templateVariables`: (optional) To add dynamic variables to form body field.
143
156
 
157
+ - `ownerId`: (optional) To provide the `id` of the owner if it is not an
158
+ Organization model. If the owner is an Organization, this prop can be left
159
+ unspecified.
160
+
144
161
  ### Usage
145
162
 
146
163
  ```js